[dokuwiki] Re: What about tpl_button('back') ?

  • From: Oliver Geisen <oliver.geisen@xxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 18 May 2006 08:14:20 +0200

Hi,

what does tpl_button('back') ?

When you create a namespaces and place a page with the same name inside
the namespace, the 'back' Button will always return to this page,
doesn't mater which page from this namespace you currently watching and
how many pages you visited in between.

Ok, this is like an index-page, right ?!
What i am looking for is a REAL back-button. One might say "just use the browse ones", but they will step over EVERY page, even those where content was edited. So what i want is to use the breadcrumb- list like a stack, which means the last page visited (not the current one) is on top of the stack (which holds 20 or so pages...) and the back-button pop's the last element of this stack an go to the referred page.
I don't think about a forward button.
Or maybe there should be a pointer which points to the current page and is inc- or decremented each back/forward operation.


Seems a bit special but I needed and still use this button. ;-)
I've written a hierachical index, alternative to the one from dokuwiki which i found confusing, and use pages named 'index' and their h1 to display it's track.

May one will give it a try, i added the source hiere. Just place it into the main.php:
------------------------------------------------------------------------ ----------------
<?
/*
* Show namespace-path to current page ($ID) like directory path.
* Use first heading of 'index.txt' page of every namespace to show.
*/
function mytpl_hierlist(){
global $conf;
global $ID;
global $lang;


  $nsdelim = '&rArr;';
  $pagedelim = '/';
  $parts = explode(':', $ID);

  // show startpage as first element
  tpl_link(wl($conf['start']),"Start",'title="Start"');

  // pop name of current page from $parts-array
  $page = array_pop($parts);

  if ($parts) {
    // list namespace-titles of remaining parts
    $ns = '';
    foreach ($parts as $part){
      $ns .= $part . ':';
      $nsindex = $ns . 'index';
      print '<span class="bcsep">'.$nsdelim.'</span>';

// try to get first heading from existing index-page
if((file_exists(wikiFN($nsindex))) &&
($nstitle=p_get_first_heading($nsindex))){
tpl_link(wl($nsindex),$nstitle,'title="'.$nstitle.'"');
}else{
// print link in "non-existing" style
tpl_link(wl($nsindex),$part,'title="'.$part.'" class="wikilink2"');
}
}
}
}
------------------------------------------------------------------------ ----------------


Oliver Geisen
_____________________________
Systemadministrator
Kreisboten Verlag Mühlfellner KG
82362 Weilheim i. Ob.
Tel. 0881/686-904
Fax 0881/686-74


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

Other related posts: