summaryrefslogtreecommitdiff
path: root/doc/todo/beef_up_sidebar_to_allow_for_multiple_sidebars.mdwn
blob: fdaa09f26fac39d797367b7c9c53808000a54c03 (plain)

Maybe sidebar could be beefed up to take the name of a sidebar, such that I could use multiple sidebars in the same wiki. For instance, the default name would be 'sidebar', meaning the plugin looks for sidebar.pm and fills in the sidebar slot, but I might also want a footer in footer.pm, filling the template's footer slot.

One good way (if possible) would be to provide a directive like \[[!sidebar id=sidebar]] which would cause the file, in which it occurred to fill the slot SIDEBAR in the template: basically, a page foo.mdwn says \[[!fillslot slot=myslot]] and then its contents should go into <TMPL_VAR SLOT_MYSLOT> for all pages. Ideally, this can then be overridden, so if /bar/foo.mdwn also references myslot then pages under /bar should get those contents instead.

--[[madduck]]

In mine I just copied sidebar out and made some extra "sidebars", but they go elsewhere. Ugly hack, but it works. --[[simonraven]]

Here a simple [[patch]] for multiple sidebars. Not too fancy but better than having multiple copies of the sidebar plugin. --[[jeanprivat]]

I made a [[git]] branch for it [[!template id=gitbranch branch="privat/multiple_sidebars" author="[[jeanprivat]]"]] --[[jeanprivat]]

Ping for [[Joey]]. Do you have any comment? I could improve it if there is things you do not like. I prefer to have such a feature integrated upstream. --[[JeanPrivat]]

The code is fine.

I did think about having it examine the page.tmpl for parameters with names like FOO_SIDEBAR and automatically enable page foo as a sidebar in that case, instead of using the setup file to enable. But I'm not sure about that idea..

The full compliment of sidebars would be a header, a footer, a left, and a right sidebar. It would make sense to go ahead and add the parameters to page.tmpl so enabling each just works, and add whatever basic CSS makes sense. Although I don't know if I want to try to get a 3 column CSS going, so perhaps leave the left sidebar out of that.



Further thoughts about this

(since the indentation level was getting rather high.)

What about using pagespecs in the config to map pages and sidebar pages together? Something like this:

One could do something similar for pageheader, pagefooter and rightbar if desired.

Another thing which I find compelling - but probably because I am using [[plugins/contrib/field]] - is to be able to treat the included page as if it were part of the page it was included into, rather than as an included page. I mean things like [[!if ...]] would test against the page name of the page it's included into rather than the name of the sidebar/header/footer page. It's even more powerful if one combines this with field/getfield/ftemplate/report, since one could make "generic" headers and footers that could apply to a whole set of pages.

Header example:

Footer example:

(Yes, I am already doing something like this on my own site. It's like the PmWiki concept of GroupHeader/GroupFooter)

-- [[KathrynAndersen]]

[[!tag wishlist]]