Issue Details (XML | Word | Printable)

Key: DOXIA-319
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Lukas Theussl
Reporter: Albert Kurucz
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Maven Doxia

Improve toc macro for CSS

Created: 11/May/09 11:23 AM   Updated: 13/May/09 02:03 AM   Resolved: 13/May/09 02:03 AM
Component/s: Core
Affects Version/s: 1.1
Fix Version/s: 1.1.1

Time Tracking:
Not Specified

Environment: any
Issue Links:
Duplicate
 


 Description  « Hide

The toc macro in APT works great!
example: %{toc|section=0}

But.

It would be nice to make it CSS friendly with an divId= and/or divClass= parameter.
example: %{toc|section=0|divID=myTOC}

If divId or div/Class parameter exists, the toc macro should change the enclosing <div class="section"> accordingly.
If there is no enclosing <div class="section">, then create an additional <div> around the generated <ul><li> structure, which has the id/class as specified.



Albert Kurucz added a comment - 11/May/09 11:29 AM - edited

Even better:
It would be nice if the divID parameter exists, then the generated TOC, should show outside of both
<div id="bodyColumn">
<div id="contentBox">

(with the speficied id).
This would allow the CSS programmer to put the TOC into the navigation column, where it really belongs.


Lukas Theussl added a comment - 12/May/09 08:56 AM

I have committed a basic implementation, see r773896. I have also deployed a doxia snapshot (v. 1.1.1-SNAPSHOT) to test.

You can now add any html base attribute as a toc macro parameter, eg

%{toc|section=2|fromDepth=1|toDepth=1|id=myId|class=myClass}

this will add the parameters to the list tag:

<ul id="myId" class="myClass">...

It is possible to wrap the <ul> in a <div id=""...> if this is desired.

Whether the toc appears inside a <div class="section"> depends on whether the toc declaration appears within a section in the source document. Just move it outside if you don't want it there.

I do not see a way to move the toc outside the bodyColumn or the contentBox as these are put in place by the siterenderer, ie outside doxia, after the sourc docs have been parsed.


Albert Kurucz added a comment - 12/May/09 10:54 AM

It would be so nice if the Site renderer could create a vertical menu from the TOC, like this site has (mine):
http://www.jtstand.com/

I think the <div> of TOC should be outside of the bodyColumn and the contentBox to be able to do this.
Correct me if I am wrong!


Lukas Theussl added a comment - 13/May/09 01:55 AM

I don't think the TOC macro was meant to provide this functionality. It was designed to work within single pages, not whole sites (DOXIA-40).

What you want should rather be accomplished by some outside plugin, like the site plugin does with site.xml, and I am currently thinking about the same functionality for the pdf plugin.

So as far as Doxia is concerned, I will close this issue as fixed, you may open another feature request for the site renderer or site plugin.