Patch #2010

Wiki Sidebar: Adding a (navigational / TOC) section

Added by Christian Zuckschwerdt about 11 years ago. Updated over 9 years ago.

Status:ClosedStart date:2008-10-08
Priority:NormalDue date:
Assignee:-% Done:

30%

Category:Wiki
Target version:-

Description

It would be nice if we could show a special page (if available) in the Wiki Sidebar section.
That way projects can display a list of hot links, a custom TOC or other infos on all wiki pages.
Maybe this can be generalized for other areas of redmine too.

Attached is a simple concept patch for r1928.

redmine-r1928-sidebar.patch Magnifier (888 Bytes) Christian Zuckschwerdt, 2008-10-08 22:37

trac.png (145 KB) Ben Blanco, 2009-01-28 11:59

redmine.png (267 KB) Ben Blanco, 2009-01-28 11:59

redmine-r2641-sidebar.patch Magnifier - redmine-r2641-sidebar.patch (779 Bytes) Christian Zuckschwerdt, 2009-03-30 17:03


Related issues

Related to Redmine - Feature #5208: Aibility to edit wiki sidebar Closed 2010-03-29

History

#1 Updated by Christian Zuckschwerdt about 11 years ago

Sorry. This is not a defect. Is it possible to change this to "Feature Request"?

#2 Updated by Jean-Philippe Lang about 11 years ago

  • Tracker changed from Defect to Patch

#3 Updated by Ben Blanco almost 11 years ago

Hi Christian,

We're looking for the same feature/functionality. We switched over to redmine from trac where we used the TocMacro plugin.

It's really nice to have a native built-in TOC feature in redmine wiki pages - as well as the ability to have parent/child crumbs.

However, our users still get lost and are asking for easier navigation - ie. like we have before. Thus we'd like to be able to reinstate a global TOC for our projects' wikis in redmine. The TOC in trac was easy to edit, ie. just another wiki page using same wiki syntax -> it would be ideal to have something equally as simple in redmine, with added difference of being able to also list redmine default wiki views:
  • Index by title
  • Index by date

Here is what we had:

And how it'd be, aside from color-scheme:

Does your patch allow for this? Will it run on 0.8?

Thanks

#4 Updated by Christian Zuckschwerdt almost 11 years ago

  • % Done changed from 0 to 30

Ben,

that's exactly my motivation. The patch provides that sidebar using a wiki page named 'Sidebar'. Did you try it? Perhaps the patch needs an update. It runs fine here and I'm still waiting for a general approval from the devs to make this a full-blown feature.

#5 Updated by Ben Blanco almost 11 years ago

Hi Chris,

Thanks for the feedback - we should be giving this a spin tomorrow ;)

#6 Updated by Ben Blanco almost 11 years ago

Hi Chris,

We put this in place, and Wow, what a night&day difference it's made for us. Thanks!

Ben

#7 Updated by Vianney Lecroart almost 11 years ago

Hi Chris,

Thanks for this patch, really useful, I added it on my redmine!

#8 Updated by Mischa The Evil over 10 years ago

Christian Zuckschwerdt wrote:

...The patch provides that sidebar using a wiki page named 'Sidebar'. Did you try it? Perhaps the patch needs an update. It runs fine here and I'm still waiting for a general approval from the devs to make this a full-blown feature...

This still works in the basics on the current trunk at r2641. One issue that comes up though are the section-links on headings which now points to the incorrect pages...

#9 Updated by Christian Zuckschwerdt over 10 years ago

One issue that comes up though are the section-links on headings which now points to the incorrect pages...

Can you provide an example? In case you refer to the automatic anchors/links on headings, you can not have headings with exactly the same name in both content and sidebar.

#10 Updated by Mischa The Evil over 10 years ago

Christian Zuckschwerdt wrote:

One issue that comes up though are the section-links on headings which now points to the incorrect pages...

Can you provide an example? In case you refer to the automatic anchors/links on headings, you can not have headings with exactly the same name in both content and sidebar.

That's exactly what I meant... The automatic anchors/links are pointing to the current page which breaks them and as a side-effect of that duplicates can occur (which will raise an error I guess).

#11 Updated by Christian Zuckschwerdt over 10 years ago

Can you give a bit more detail? Say I put a "h3. Foobar" in the Sidebar. There will be an anchor #Foobar and a link to #Foobar on every page. No problem there, or am I missing something?
If you then put the same name Say "h1. Foobar" on some page you are in trouble. But content authors will always need to be careful there. I.e. you can't use "h1. Foobar" and say "h2. Foobar" on the same page anyhow.

#12 Updated by Mischa The Evil over 10 years ago

Christian Zuckschwerdt wrote:

Can you give a bit more detail? Say I put a "h3. Foobar" in the Sidebar. There will be an anchor #Foobar and a link to #Foobar on every page. No problem there, or am I missing something?

This is the thing I see as a problem: The anchor/link #Foobar in your example is pointing to a non-existing section on the current page if no such heading is used in the current page...

#13 Updated by Christian Zuckschwerdt over 10 years ago

The anchor/link #Foobar in your example is pointing to a non-existing section on the current page if no such heading is used in the current page...

Let clear this up some. That automatic link is pointing to the that same automatic anchor. I.e. when you add a heading "Foobar" it gets an id of "Foobar" serving as anchor for the link "#Foobar". It doesn't matter if this happens to be content or Sidebar. Did you experience otherwise? You can't use automatic links in the Sidebar to point to some content section.
Maybe you are talking about some manual links? Can you provide an example?

#14 Updated by Mischa The Evil over 10 years ago

Christian Zuckschwerdt wrote:

Mischa The Evil wrote:

The anchor/link #Foobar in your example is pointing to a non-existing section on the current page if no such heading is used in the current page...

Let clear this up some. That automatic link is pointing to the that same automatic anchor. I.e. when you add a heading "Foobar" it gets an id of "Foobar" serving as anchor for the link "#Foobar". It doesn't matter if this happens to be content or Sidebar. Did you experience otherwise?

It does matter IMHO since this creates non-existent (automatically generated) anchor-links in the sidebar when using a sidebar-page.

For example with a Sidebar-page like following

h1. Sidebar

h2. Testers

* [[Test1]]
* [[Test2]]

h2. Others

* [[Other1]]
* [[Other2]]

my startpage (named Wiki) includes the Sidebar-page in the wiki-sidebar but this " partial " also includes automatically generated anchor-links on the headings (Testers and Others) pointing to these same anchors though on the current startpage (Wiki) which doesn't include headings (thus anchors) named Testers and Others.

Pff, seems difficult to explain but hope I made clear what I mean... :wink:

Christian Zuckschwerdt wrote:

You can't use automatic links in the Sidebar to point to some content section.

Agreed and acknowledged... Seems logical indeed ;-)

#15 Updated by Christian Zuckschwerdt over 10 years ago

my startpage (named Wiki) includes the Sidebar-page in the wiki-sidebar but this " partial " also includes automatically generated anchor-links on the headings (Testers and Others) pointing to these same anchors though on the current startpage (Wiki) which doesn't include headings (thus anchors) named Testers and Others.

Ok, I see. But don't these automatic links point to just the headings in the Sidebar?

It seems you want the automatic links to point to content (which would be nice indeed).

Maybe the simple solution would be to remove automatic linking from Sidebar headings. It's just confusing and not that many people would want to link to a sidebar section anyway.

TODO:
  • remove automatic links from Sidebar headings
  • change Sidebar heading styles to match the existing Redmine sidebar items
  • Advise users to start with h3 in the Sidebar

#16 Updated by Christian Zuckschwerdt over 10 years ago

TODO:
  • remove automatic links from Sidebar headings
  • change Sidebar heading styles to match the existing Redmine sidebar items
  • Advise users to start with h3 in the Sidebar

Here is an updated patch. The Sidebar css styles now match the original sidebar. It's intended for #2641.

#17 Updated by Christian Zuckschwerdt over 10 years ago

Huh, where did the attachment go?

#18 Updated by Mischa The Evil over 10 years ago

Christian Zuckschwerdt wrote:

Huh, where did the attachment go?

Hehe, I think it got lost due to our cuncurrent edit-actions I guess...

Christian Zuckschwerdt wrote:

...But don't these automatic links point to just the headings in the Sidebar?

AFAICT they don't... :-)

It seems you want the automatic links to point to content (which would be nice indeed).

I don't want and/or need it. I think it would make the implementation too difficult. I like your initial KISS-approach... :-)

Maybe the simple solution would be to remove automatic linking from Sidebar headings. It's just confusing and not that many people would want to link to a sidebar section anyway.

+10... This seems the best solution IMHO too...

Thanks for supporting this patch...

Kind regards,

Mischa.

#19 Updated by Christian Zuckschwerdt over 10 years ago

Problem with Safari maybe?

#20 Updated by Andy Wiltshire over 10 years ago

Is this still current?

I applied the latest patch to the latest version of redmine (15th June 09) and the sidebar intermittently disappears. As in, it 'kinda' works, then when you reload or go to another page, it disappears etc.

Any ideas?

#21 Updated by Mischa The Evil over 10 years ago

Andy Wiltshire wrote:

Is this still current?

I applied the latest patch to the latest version of redmine (15th June 09) and the sidebar intermittently disappears. As in, it 'kinda' works, then when you reload or go to another page, it disappears etc.

Note sure about the current state of the patch but to be sure: have you actually created the Sidebar-wikipage as given in the instructions?:

The patch provides that sidebar using a wiki page named 'Sidebar'

Regards,

Mischa.

#22 Updated by Jens Goldhammer over 10 years ago

+1 for integrating it into the trunk

#23 Updated by Mischa The Evil over 10 years ago

Jens Goldhammer wrote:

+1 for integrating it into the trunk

This seems to be at least implemented as part of the Wiki Extensions plugin (thus you don't need to rely on core-modifications to get the desired feature).

Regards,

Mischa.

#24 Updated by Jean-Philippe Lang over 9 years ago

  • Category set to Wiki
  • Status changed from New to Closed

Feature added in r3632.

Also available in: Atom PDF