More method for numeric

tomaszx - April 23, 2008 - 12:54
Project:Table of Contents
Version:6.x-3.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:AlexisWilke
Status:closed
Description

Hi.

I think that should be able to select method of numeric:
Example

1.
2.
  1.
  2.

or

1. aaa
  1.1 from aaa
2. bbb
  2.1 from bbb
  2.2 from bbb
    2.2.1 from from bbb

#1

deviantintegral - April 23, 2008 - 15:38
Status:active» won't fix

Unfortunately, there is no way to do your second style with CSS. If you want to change the style to something different, you could add something like this to style.css:

.toc-list ol {
  list-style-type: upper-roman;
}

w3schools has a good summary of valid CSS list types.

--Andrew

#2

tomaszx - April 29, 2008 - 11:47

Maybe try:

BODY {
    counter-reset: rozdzial;  /* set main level to 0 */
}
H1:before {
    content: "Rozdział " counter(rozdzial) ". ";
    counter-increment: rozdzial; /* increment 1*/
}
H1 {
    counter-reset: section;      /* set section to 0  */
}
H2:before {
    content: counter(rozdzial) "." counter(section) " ";
    counter-increment: section;
}

or in php code but i dont have any ide how you are implement this :)

#3

deviantintegral - May 1, 2008 - 17:55
Status:won't fix» postponed (maintainer needs more info)

Those CSS properties are really useful - thanks for pointing them out!

What you've posted would add numbered headings to headings automatically, which in itself is a useful feature. It would need to be limited so that it didn't number headings on inappropriate pages. The way I see it there are two pieces of functionality now:

  1. Allow for different formats in numbering in the Table of Contents list. There are a few list styles built in to CSS (such as roman numerals), but others might need to be implemented as suggested in #2.
  2. Automatically show matching numbers in section headings, presumably matched to whatever style is selected for the table of contents.

I think only solutions using pure CSS should be considered acceptable, as changing the content headings themselves in the input filter could get messy really quickly.

If someone submits a patch with the above two features I'll be glad to take a look. I might get to this myself, but who knows when it will actually happen :)

--Andrew

#4

AlexisWilke - July 5, 2009 - 10:40
Version:6.x-2.x-dev» 6.x-3.x-dev
Assigned to:Anonymous» AlexisWilke
Status:postponed (maintainer needs more info)» active

The problem is that those CSS do not work on all browsers. Whereas, adding the counters in PHP would work. That should be relatively easy to do also and I like it. We'll see...

Thank you.
Alexis

#5

AlexisWilke - July 5, 2009 - 23:22
Status:active» fixed

This is done in PHP. Really, forget CSS for that sort of a thing!

It's in 3.x-dev Jul 5, 2009.

Thank you.
Alexis Wilke

#6

System Message - July 19, 2009 - 23:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.