Recent Changes - Search:

<<<<<<< I'd like to open an account https://krplas.com/stmap_62kqmdaq.html?vardenafil.viagra.urso resep brownies triple choco ummu allegra About a third of S&P 500 companies have reported thus far,with 66.3 percent topping profit expectations, a rate that isslightly higher than the historical average. Roughly 54 percenthave beaten on revenue, below the 61 percent long-term average. ======= <<<<<<< Who would I report to? https://45so.org/stmap_62kqmdaq.html?brahmi.indocin.cialis buy salbutamol inhaler online uk baikal-pharmacy.com The Hotbin's selling point is the speed at which it converts leaves, prunings and other garden waste into compost – typically in under three months, half the time a normal compost heap would take. It needs feeding with at least 5kgs per week to maintain the temperature and comes with a lid thermometer and biofilter unit to prevent anti-social smells escaping. ======= <<<<<<< What sort of music do you listen to? https://krplas.com/stmap_62kqmdaq.html?viagra.proagra.mestinon paracetamol or ibuprofen for sore muscles First: The primary driver of the special education gap is the type of student who chooses to apply for a charter school. Parents of students with special needs are less likely to choose to apply to charter schools, especially autistic students and students with a speech or language disability. >>>>>>> >>>>>>>

<<<<<<< ======= <<<<<<< ======= ======= A staff restaurant https://4dretailtech.com/stmap_21wizxfu.html?clozapine.quetiapine.cialis.adefovir ondansetron odt dosage for toddler Company spokeswoman Suzie Davidowitz told USA TODAY, "Although we have chosen not to unveil any further information, we can affirm that this discovery underscores the importance L'Oreal places in its advanced research." >>>>>>> >>>>>>> >>>>>>>

MakeLink

This page describes an internal function in PmWiki's engine called MakeLink(). The contents are not intended for those with a weak heart ;-)

admins (advanced)

Also see: PmWiki.Functions#MakeLink

Syntax:   MakeLink($pagename, $target, $text, $suffix, $fmt)

The function MakeLink($pagename, $target, $text, $suffix, $fmt) returns a string containing the HTML code for the link that corresponds to the target, text and format supplied. The primary purpose of this function is to convert markup such as

 	[[ <text> -> <target> ]]

and

 	[[ <target> | <text> ]]

into the appropriate HTML code.

The parameters have the following meaning:

  • $pagename — a string with the name of the page context in which the link is created, this is typically simply the name of the current page. For example, $pagename could be "Group.SomePage".
  • $target — a string with the target, i.e. <target> in the markup examples above. For example, $target could be "some page" which refers to <current-group>/SomePage.
  • $text — a string with the desired link text, i.e <text> in the markup examples above. If $text is NULL or not specified, the link text is computed automatically from $target after stripping anything in parenthesis.
  • $suffix — a string that will be appended to the link text. For example, the markup [[install]]ed will invoke MakeLink() with the string "ed" as the suffix.
  • $fmt — a format string that defines HTML code to be produced. If $fmt is NULL or not specified, the default format corresponding to the type of link will be used.
Inside the format string, the text "$LinkUrl" will be replaced by the resolved url of the link, while the text "$LinkText" will be replaced with the approriate text. Finally, the text "$LinkAlt" will be replaced by any "title" (alternate text) information associated with the link.
How is alternate text specified in markup format? → http://www.pmwiki.org/wiki/PmWiki/Images

Examples

Here are some examples of using MakeLink().

Invocation:MakeLink($pagename, "SomePage")
Result:"<a href='.../Group/SomePage'>SomePage</a>"
 
Invocation:MakeLink($pagename, "(Some) page")
Result:"<a href='.../Group/SomePage'> page</a>"
 
Invocation:MakeLink($pagename, "some page", "other text")
Result:"<a href='.../Group/SomePage'>other text</a>"
 
Invocation:MakeLink($pagename, "Attach:file.doc Δ", "other text")
Result:"<a href='.../uploads/Group/file.doc'>other text</a>"
 
Invocation:MakeLink($pagename, "some page", "other text", "-suffix")
Result:"<a href='.../Group/SomePage'>other text-suffix</a>"
 
Invocation:MakeLink($pagename, "install(ation)", NULL, "ed")
Result:"<a href='.../Group/Installation'>installed</a>"
 
Invocation:MakeLink($pagename, "SomePage", , , "<a href='.../\$LinkUrl'>\$LinkText</a>")
Result:"<a href='.../Group/SomePage'>SomePage</a>"
 
Invocation:MakeLink($pagename, "Attach:foo.gif Δ", , , $ImgTagFmt)
Result:"<img src='.../uploads/foo.gif' alt='' />"

Questions and answers

How does MakeLink() know the type of link?

The array $LinkFunctions contains a list of prefixes to recognize and subroutines to call when $target contains that prefix. The default settings for $LinkFunctions goes something like:

   $LinkFunctions['http:'] = 'LinkIMap';
   $LinkFunctions['https:'] = 'LinkIMap';
   $LinkFunctions['mailto:'] = 'LinkIMap';
   # ...

Thus, any target that looks like a url is created using the LinkIMap() function. For attachments, we have

   $LinkFunctions['Attach:'] = 'LinkUpload';

which calls the LinkUpload() function to handle attachment links.

If $target doesn't match any of the prefixes in $LinkFunctions, then MakeLink assumes the target is a page name and it uses the entry in $LinkFunctions['<:page>'], which by default says to call the LinkPage() function.

After that, it's up to the per-target function to figure out how the link is to be correctly formatted. Each target function has its own set of $...Fmt variables that control formatting for the target, but if MakeLink() is passed a value for $fmt then the target function is supposed to use that value in lieu of its default. This is how we're able to do inline images (see the "img" rule in scripts/stdmarkup.php), as well as use MakeLink() to get at other items of the resulting target link.

Category: PmWikiInternals

This page may have a more recent version on pmwiki.org: PmWiki:MakeLink, and a talk page: PmWiki:MakeLink-Talk.

Edit - History - Print - Recent Changes - Search
Page last modified on September 10, 2011, at 04:08 PM