[dokuwiki] Re: only page name (not the whole path) -> maybe plugin???

  • From: Chris Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 05 Oct 2005 16:22:51 +0100


hi,

so it should be something like this:

main.php:

<div class="print_only">
<?php
$string = "$ID";
$string = str_replace("[","",$string);
$string = str_replace("]","",$string);
$string = explode(":",$string);
$laatste = end($string);
echo "$laatste";
?>
</div>

layout.css:

.print_only {display:none;}

(I assume $ID is the path of the page?? or not?)

This should work you think??

koko

$ID is the namespace+page name. It doesn't have any "[" or "]" if you just want the page and not the name space, then use noNS($ID).

e.g.

<?php echo noNS($ID)?>

to be safe you should probably filter the output through hsc() to ensure any html special characters are converted to entities. Its not really necessary as a dokuwiki ID is may not contain any special charaters,but if that were to change you would be safe using ...

<?php echo hsc(noNS($ID))?>

Chris





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

Other related posts: