[dokuwiki] Re: code to display real/raw wiki page name

wow, thanks heaps,

<?php print $ID?> did the trick. I knew it had to be something quite obvious... for some reason I was thinking that the ID was the revision id (or some kind of static numeral). Maybe if I had URL rewriting turned off, I could have seen that from the id= part of the URL... it always seems so simply in hindsight :)

Thank you,
Ryan


Michael Klier wrote:
Ryan Jacobs wrote:
Hello!

I'd like to place some code that will display the real wiki pagename (in "namespace:pagename" format) in the footer of my template (main.php). The default template does this (in the header) with:

<?php tpl_link(wl($ID,'do=backlink'),tpl_pagetitle($ID,true))?>

The problem is that if you use the "Use first heading for pagenames" options, this will render the first heading, and not the actual wiki pagename that one would use when creating a link to that page.

Basically, I'd like to provide an easy way for "rookie" editors (who just want to make edits to individual pages and not learn the insides of the wiki structure and namespaces) to cut-and-paste the wiki pagename that they would use to define a link to a the page they are viewing.

I know that one could extract this info from the URL, but if you use the URL "/" namespace separator option, have a really long string of namespaces in the URL, or are viewing a "permanent-link" version, this can be quite confusing.

Perhaps there is a small mod to the code example above that will do what I need?

Any info greatly appreciated!

Hi,

I think the following should suffice:

<?php print $ID?>

If you like to have a link use this one:

<?php tpl_link(wl($ID,'',$ID)) ?>

HTH,
    Chi

--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: