Not logged in. · Lost password · Register
Forum: General Help and Support Templates and Layout RSS
arctic-mbo: link to current page in sidebar and wiki page
Avatar
anandr #1
Member since Oct 2011 · 18 posts
Group memberships: Members
Show profile · Link to this post
Subject: arctic-mbo: link to current page in sidebar and wiki page
I just downloaded latest dokuwiki “Angua” and arctic-mbo template.
In my testing wiki both sidebar and wiki page have link to the wiki page:
[[:test:start|Test]]
The link on the wiki page is wrapped with <span class=“curid”> … </span> while the same link on hte sidebar is not.
I modified lib/tpl/arctic-mbo/layout.css with this code:
/* ---- Current ID highlighting ---- */
.curid {
  font-weight: bold;
}
and now only links inside wiki pages are bold, sidebar links are still normal-weighted.

The file inc/parser/xhtml.php is responsible for this functionality. As far as I understand arctic-mbo uses xhtml renderer to present sidebars but apparently it is not working.
Who (dokuwiki or arctic-mbo) is the one to misbehave?

Update: Just checked arctic template -- same thing.
This post was edited on 2011-12-28, 15:40 by anandr.
Avatar
anandr #2
Member since Oct 2011 · 18 posts
Group memberships: Members
Show profile · Link to this post
I guess I found the problem. At least it seems so.
Correct me if I'm wrong, but it seems that when dokuwiki parser is parsing the sidebar page, page ID is the sidebar page ID, not the wiki page ID.
I tested it the following way. I inserted the same text into sidebar and a wiki page (they both are in same namespace):

  [[:test:start|Test]] \\
  [[:test:sidebar|Test sidebar]] \\

Now when I type in my browser http://localhost/wiki/test/start
I see this in the sidebar
   Test
   Test sidebar
and this in the wiki page
   Test
   Test sidebar

Consequently when I type in my browser http://localhost/wiki/test/sidebar
I see this in the sidebar
   Test
   Test sidebar
and this in the wiki page (which is actually the same sidebar just displayed as wiki page)
   Test
   Test sidebar

Is there any way to synchonize the two?
Avatar
anandr #3
Member since Oct 2011 · 18 posts
Group memberships: Members
Show profile · Link to this post
I think I found the solution to this annoying bug.

In the tpl_functions.php file of the http://www.dokuwiki.org/template:arctic-mbo template I replaced first line of the p_sidebar_xhtml function (where sidebar contents is loaded and rendered) so instead of
    $data = p_wiki_xhtml($sb,'',false);
it looks like this:
    $data = p_render('xhtml',p_get_instructions(io_readWikiPage(wikiFN($sb),$sb)),$iinfo);
Now links to current page both in sidebar and in the wiki page itself are wrapped with <span class=“curid”> … </span>

Could someone confirm that this patch does not break template functionality and does not introduce another bugs?
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Current time: 2014-04-19, 01:16:37 (UTC +02:00)