History: Wiki-Syntax Links
Source of version: 151 (current)
Copy to clipboard
! Wiki-Syntax Links In this page, you'll learn how to include links in your ((Wiki)) pages, including links to other Wiki pages within the same Tiki site, links to an external Wiki site, and links to the Web. {ANAME()}quick{ANAME} !! Quick Reference {FANCYTABLE(head=>"__To...__ ~|~ __Default Syntax__ ~|~// __Optional Syntax{SUP()}1{SUP}__>> ~|~ ~|~''Syntax'' ~|~ ''Requires...''" )} Link to a Wiki page ~|~ ~np~((Wiki Page Name))~/np~ ~|~ ~np~WikiPageName~/np~ ~|~ WikiWords{SUP()}2{SUP} Link to an external Wiki page ~|~ ~np~((Ext Wiki Name: Ext Wiki Page Name))~/np~ ~|~ ~np~ExtWikiName: ExtWikiPageName~/np~ ~|~ WikiWords{SUP()}2{SUP} Link to a Web page ~|~ ~np~[http://www.somesite.org] ~/np~ ''or'' %%%~np~[http://www.somesite.org|Some Site!]~/np~ ~|~ ~np~http://www.somesite.org~/np~ ~|~ AutoLinks{SUP()}3{SUP} {FANCYTABLE}In HTML5 it is possible to use ~np~[//foo.example.org/|foosite]~/np~ to preserve the protocol (http or https). {img src="img/icons/book_open.png"} __Notes:__ #Tiki includes two options that modify the default link syntax: __WikiWords__ and __Autolink__. #To enable [Wiki+Config#Use_WikiWordsWikiWords|WikiWords]: **From the ((Wiki Config|Administration: Wiki page)), select the __Features__ tab. **On the Features tab, enable the __WikiWords__ option. +If the [Wiki+Config#Use_WikiWordsWikiWords|WikiWords] feature is disabled, you ''must'' use double parenthesis to create a Wiki page link. #To enable ((AutoLinks)): **From the ((Text Area|Administration: Text Area page)), select the __General Settings__ tab. In Tiki 4.x this is renamed to ''Editing & Plugins''. **On the General Settings tab, in the Miscellaneous area, enable the __AutoLinks__ option. +If the ((AutoLinks)) features is disabled, you must use the square brackets to create a link to an external page. !! Linking Within a Tiki Site !!! Wiki Pages When using the [Wiki+Config?bl=y#Use_WikiWords|WikiWords] option, Tiki will automatically detect Wiki page names and correctly format them as hyperlinks The following are methods of creating links to Wiki pages *__ ~np~TheWikiWay~/np~ __ + Two or more words are stuck together (no spaces, but accept - [[dash] and _ [[underscore]), and each is capitalized. You must enable the [Wiki+Config?bl=y#Use_WikiWords|WikiWords] option to use this mothod. *__ ~np~ ((The Wiki Way)) ~/np~ __ +Use double parentheses around the page name to Wiki page names that include spaces or when the [Wiki+Config?bl=y#Use_WikiWords|WikiWords] option is not enabled. *__ ~np~ (token-name(The Wiki Way)) ~/np~ __ +Use a ''token-name'' reference to link to wiki pages using a ((Semantic Admin|semantic link)), a qualifier. Semantic links were introduced in ((Tiki3|Tiki 3.0)) and have to be enabled separately. See ((Semantic Admin)) for more information. Trick: This can be also used to put a class on a link. This table lists additional methods for creating links to wiki pages. {FANCYTABLE(head="__To...__ ~|~ __Syntax__ ~|~ __Result__ ~|~ __Comment__" sortable="n")} Specify link text ~|~ ~np~((PluginVersions | The Versions Plugin))~/np~ ~|~ ((PluginVersions|The Versions Plugin)) ~|~ Use the vertical bar (__|__ [[pipe]) to separate the page name from the link text. \\Link to a heading or anchor on another page and specify link text ~|~ ~np~ ((Using Wiki Pages | #The_Wiki_Menu | The Wiki Menu)) ~/np~ %%%''(but no spaces around pipes)'' ~|~ ((Using Wiki Pages|#The_Wiki_Menu|The Wiki Menu)) ~|~\\ Tiki automatically creates anchors for headings on a Wiki page. For the heading or anchor, note the # character and underscores replacing spaces. ~np~ [Wiki+Plugin#Plugin_Syntax | Plugin Syntax] ~/np~ ~|~ [Wiki+Plugin#Plugin_Syntax | Plugin Syntax] Link to a heading on the same page ~|~ ~np~ [#Related_Pages|Related Pages] ~/np~ ~|~[#Related_Pages|Related Pages]~|~Note the # character and underscores replacing spaces. Link to a page with a specific tab showing~|~ ~np~[PluginImg?cookietab=3~/np~ %%% ~np~#Parameters | Params Tab3]~/np~ %%% %%%''(but no line break before #)'' ~|~ [PluginImg?cookietab=3#Parameters | Params Tab3] ~|~ Works on pages where ((PluginTabs)) is used as well as pages with built-in tabs. Linking to a heading in this example also Use a custom color for the link text ~|~ ~np~((Wiki-Syntax Text|~~#ff0000:Syntax for Text~~))~/np~ ~|~ ((Wiki-Syntax Text| ~~#ff0000:Syntax for Text~~)) ~|~ By default, the color is defined by the Tiki theme (CSS). See ((Wiki-Syntax Text)) for more information. {FANCYTABLE} {REMARKSBOX(type=tip title=Tip)} ''See ((PluginAlink)) and ((PluginAname)) for how to set anchors in a page and to link to them. These ((Wiki Plugins|plugins)) can be used to create a link to an anchor within the same page.''{REMARKSBOX} {img src=img/icons/help.png } __Help!__ *If you save the page but see a question mark (__?__) after the page name, and you're sure the page exists, search for the page in the ((Search|Search module)) to make sure you've typed the name correctly. *When using [Wiki+Config?bl=y#Use_WikiWords|WikiWords], Tiki will try to convert any word with odd capitalization into a Wiki link. Use double, reversed parentheses around a word to indicate that it ''should not'' be a wiki link -- even when the [Wiki+Config?bl=y#Use_WikiWords|WikiWords] option is enabled. For example: +__~np~))WordStar((~/np~__ will ''not'' become a link. !!!! Semantic Wiki Starting from version 3.0, Tiki supports semantic qualifiers on Wiki Links. To add a qualifier to the wiki link, the following syntax must be used: ~np~(qualifier-name(The Wiki Way))~/np~ * Qualifiers may contain lowecase letters (a-z) and dashes. * The qualifier name will be added as a CSS class on the link to customize the display. * Semantic relationships can be managed by administrators from ((Semantic Admin)). Relationships can be viewed from ((Module semantic_links)). !!! Articles, Blogs, Forums and Other Pages For all other types of pages within a Tiki site, a shortened address can be used with square brackets. Here are some examples: {FANCYTABLE(head=> __Type of Page__ ~|~ __Syntax__ ~|~ __Result__)} \\Article number 19 ~|~ ~np~ [tiki-read_article.php?articleId=19]~/np~ ~|~ [tiki-read_article.php?articleId=19] ~np~[tiki-read_article.php?articleId=19|News from doc.tw.o!] ~/np~ ~|~ [tiki-read_article.php?articleId=19|News from doc.tw.o!] Galleries ~|~ ~np~ [tiki-galleries.php|Galleries] ~/np~ ~|~ [tiki-galleries.php|Galleries] FAQ number 8 ~|~ ~np~ [tiki-view_faq.php?faqId=8|FAQ on Images] ~/np~ ~|~ [tiki-view_faq.php?faqId=8|FAQ on Images] Shadowbox popup ~|~ ~np~ [http://doc.tiki.org/tiki-print.php?page=Wiki-Syntax+Links|See this page|shadowbox;title=shadowbox example;] ~/np~ %%% ''shadowbox feature must be activated'' ~|~ [http://doc.tiki.org/tiki-print.php?page=Wiki-Syntax+Links|See this page|shadowbox;title=shadowbox example;] File gallery file ~|~ ~np~[tiki-download_file.php?fileId=284|Download PDF file]~/np~ ~|~ [tiki-download_file.php?fileId=284|Download PDF file] {FANCYTABLE} {REMARKSBOX(type=tip title=Tip)} These are only a few examples - any page within a Tiki site can be linked this way, just make note of the last part of the path when you're on that page and use that for the link.{REMARKSBOX} Note: Use ~np~[[foo]~/np~ to display ~np~[foo]~/np~ !!! Attachments and Image Links To create a link to an attachment to a wiki page, use ((PluginAttach)) or ((PluginFile)). If you'd like for an image to act as a link, so that clicking on the image takes you to another page, see the [PluginImg&cookietab=2#Parameters | link image tab] under Parameters on the ((PluginImg)) page. !!!! Link to an image in a popup {CODE(wrap=1)}[display37|Click here to see the image in a popup|shadowbox]{CODE} [display37|Click here to see the image in a popup|shadowbox] !!! Display a Specific Tab If ((PluginTabs)) is used on a page, the following syntax can be used to display specific tab within that page without refreshing the page: {TABS(tabs="Version 7|Before Version 7")} {CODE(wrap=1)}{HTML()}<a href="#tab2" onclick="tikitabs(2); return false;">Tab 2</a>{HTML}{CODE} ///// {CODE(wrap=1)}{HTML()}<a href="#tab2" onclick="tikitabs(2,4,1); return false;">Tab 2</a>{HTML}{CODE} {TABS} Here are the key parts of the syntax: * {DIV(type=span class=inline_syntax)}tikitabs(2){DIV} (with version 7.0) or {DIV(type=span class=inline_syntax)}tikitabs(2,4,1){DIV} (before 7.0): ** {DIV(type=span class=inline_syntax)}2{DIV} means the second tab will be displayed when the link is clicked ** 4 means there are 4 tabs in total (before 7.0) ** Always use 1 for the third number (before 7.0) * {DIV(type=span class=inline_syntax)}href="#tab2"{DIV} - this can be any text, except that it should start with a # * {DIV(type=span class=inline_syntax)}Tab 2{DIV} - this will be the text that shows as a link Here's an example: {HTML()}<a href="#tab2" onclick="tikitabs(2); return false;">Tab 2</a>{HTML} {TABS(tabs="First Tab|Second Tab|Third Tab|Fourth Tab")} First tab ///// Second tab ///// Third tab ///// Fourth tab {TABS} !!! Navigation Links Here are some plugins that provide navigational links: * ((PluginAname)) - creates an anchor on a wiki page. * ((PluginAlink)) - links to an anchor in a wiki page. Use in conjunction with ((PluginAname)) * ((PluginBack)) - creates a link to go back one page * ((PluginBacklinks)) - shows all the pages that link to a page * ((PluginRedirect)) - causes links to a page to redirect to another page !! Linking to Other Wiki Sites If the site administrator has enabled this option, shortened links to pages in an external Wiki can be created. You'll need to know the short name that the administrator has set up to use this feature - the information may be documented on the site in a ((TikiWiki Manual of Style)) or you can ask your administrator. See ((External Wikis)) for a complete explanation as well as the shortcut links for external wikis that have been defined on this site (under the heading ((External Wikis|#List_external_wiki_references|List external wiki references))). !! Linking to Web Pages You can link to any page on the Web that has a valid URL. By default, Tiki creates a local cache of the page so that it will be available even if the remote Web site is down. Here are some examples of the syntax: {FANCYTABLE(head=> __Description__ ~|~ __Syntax__ ~|~ __Result__ )} Link to an external web page ~|~ ~np~[http://www.wiki-translation.com]~/np~ ~|~ [hhttp://www.wiki-translation.com] Specify link text ~|~ ~np~[http://www.wiki-translation.com|Wiki Translation]~/np~ ~|~ [http://www.wiki-translation.com|Wiki Translation] With ))AutoLinks(( enabled ~|~ ~np~http://www.wiki-translation.com~/np~ ~|~ [http://www.wiki-translation.com] Using a color font ~|~ ~np~[http://www.tiki.org|~~#ff0000:tw~~]~/np~ ~|~ [http://www.tiki.org|~~#ff0000:tw~~] Open in new window (if feature activated)~|~ ~np~[http://tiki.org|hello tiki.org|target]~/np~ ~|~ [http://tiki.org|hello tiki.org|target] {FANCYTABLE} See the [#Quick_Reference|Quick Reference] section above for how to set the ((AutoLinks)) administrative option. In addition, two more administrative options related to external links: *__To open external links in new window:__ +Go to ''Setting > Control Panels > Editing and Plugins > General Settings > External links and images'' and check ''Open external links in new window'' and click "Change Preferences." If this feature is disabled, external links open in the existing browser window. + %%% *__To disable the external link icon ({img src="img/icons/external_link.gif"}):__ +Go to ''Setting > Control Panels > Editing and Plugins > General Settings > External links and images'' and uncheck ''External link icon'' then click "Change Preferences." With this disabled, the icon ({img src="img/icons/external_link.gif"}) will no longer appear at the end of any external links. Keeping it enabled allows users to know when they are being directed to another site. {img src="img/smiles/icon_exclaim.gif"} __Important__: If you are linking to a PDF file, a multimedia file, or any file other than an HTML page, please include the ''nocache'' directive, as in the following examples: * ~np~[http://www.somesite.org/docs/chapter1.pdf |nocache]~/np~ * ~np~[http://www.somesite.org/docs/chapter1.pdf|Chapter One|nocache]~/np~ {img src=img/icons/help.png } __Help!__ * If the link doesn't work, try copying the URL into your browser window, and click Enter. If the page exists, go back and check your typing. Chances are you'll find that you've made a typing error. Did you type both brackets correctly? !!! Opening links in semitransparent popup (colorbox) You need to add the extra text "__|box__" (or maybe "__|shadowbox__" in earlier releases, if __box__ doesn't work for you) after the label of your external link. You can also add some params, if needed, for the external resource, followed by semicolons. ===Example1=== Show a YouTube video in semitransparent popup (colorbox) in full screen size. {CODE(wrap=1)}[http://www.youtube.com/v/KBewVCducWw&autoplay=1|You Tube video in their flash player|box]{CODE} Which would produce: [http://www.youtube.com/v/KBewVCducWw&autoplay=1|You Tube video in their flash player|box] ===Example2=== Show a YouTube video in semitransparent popup (colorbox) but with defined smaller size than full screen: {CODE(wrap=1)}[http://www.youtube.com/v/KBewVCducWw&autoplay=1|You Tube video in their flash player|shadowbox;width=405;height=340;]{CODE} Which would produce: [http://www.youtube.com/v/KBewVCducWw&autoplay=1|You Tube video in their flash player|shadowbox;width=405;height=340;] !!! Linking to Email Addresses To link to an Email Address, enclose the ''mailto URL'' within square brackets, as in the following examples: * ''Type this:'' ~np~[mailto:johndoe@example.org]~/np~~hs~~hs~ + ''To get this:'' [mailto:johndoe@example.org] * ''Type this:'' ~np~[mailto:johndoe@example.org | John Doe]~/np~ + ''To get this:'' [mailto:johndoe@example.org | John Doe] !!!Tips * to enter a text between brackets. Put 2 open brackets, the text and one closing brackets like this ~np~[[xxxx]~/np~ that will output [[xxxx] {include page="Tooltips" start="~tc~begin include~/tc~" stop="~tc~end include~/tc~"} !!Link Cache Whenever Tiki finds a link to an external site in a Wiki page the link is cached in the Tiki cache, this allows the Wiki users to visit the page even if the site is offline or the page is removed or changed. When you make a link in a Wiki page, you can choose to request that it not be cached. This is done by adding the phrase |nocache after the link description between the square brackets. Admins, see ((Link Cache)). !! Related Pages * ((AutoLinks)) - enable the option for tiki to automatically recognize external links as links * ((External Wikis)) - create shortcut links to other wiki sites * ((PluginAlink)) - links to an anchor in a wiki page. Use in conjunction with ((PluginAname)) * ((PluginAname)) - creates an anchor onto a wiki page * ((PluginAttach)) - a plugin for placing a link to an attachment on a page * ((PluginBack)) - creates a link to go back one page * ((PluginBacklinks)) - shows all the pages that link to a page * ((PluginFile)) - similar to ((PluginAttach)) * ((PluginImg)) - turn an image into a link * ((PluginRedirect)) - causes links to a page to redirect to another page