#navigation class and currentLevel separated or omitted

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

#navigation class and currentLevel separated or omitted

Ted Vinke
Wow, I reported a bug for the #navigation macro (appended underscore
seemed buggy) and it has been fixed in in de dotCMS trunk! Great work!

Now one of my CSS designers asked if it was possible to seperate my own
specified class and the currentLevel as 2 different classes?

#set($firstItemClass = "firstItem")
#set($lastItemClass = "lastItem")
#navigation(2 2)

This now generates:

<ul>
<li><a class="firstItem_1" href="/whoarewe/news.dot">News</a></li>
<li><a href="/whoarewe/management.dot">Management</a></li>
<li><a class="lastItem_1" href="/whoarewe/guests.dot">Guests</a></li>
</ul>


where _1 is appended because the current menu level. Now the question I
got was to indicate my own class to be seperated from the currentLevel. E.g.

#set($seperateLevel = true)
#set($firstItemClass = "firstItem")
#set($lastItemClass = "lastItem")
#navigation(2 2)

This could generate:

<ul>
<li><a class="firstItem level_1" href="/whoarewe/news.dot">News</a></li>
<li><a href="/whoarewe/management.dot">Management</a></li>
<li><a class="lastItem level_1" href="/whoarewe/guests.dot">Guests</a></li>
</ul>

where the current level is seperated, as "level_xx", from my own
"firstItem".

Ot maybe there's a way to leave out the current level e.g.
#set($skipLevel = true) or something which will omit the _xx after each
class.

In both way we can use "firstItem" correctly as a seperate CSS class
selector and - if the level is present - do different things for
different levels. E.g.

.firstItem {
        border-top: 1px solid black;
}

.firstItem .level_1 {
        color: red;
}

If seperating or omitting the level is currently not possible, I'd be
happy to add both as two seperate improvements in JIRA.

Regards,
Ted


dotCMS: Opensource CMS goodness.
http://www.dotcms.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/dotcms/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/dotcms/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 
Reply | Threaded
Open this post in threaded view
|

Re: #navigation class and currentLevel separated or omitted

Maria Ahues Bouza
Hi Ted,

Please enter this as one improvement request in JIRA.
We usually take care of bugs right away as soon as we can. :-)

Thanks
Maria

On 2/5/08, Ted Vinke <[hidden email]> wrote:

>
>   Wow, I reported a bug for the #navigation macro (appended underscore
> seemed buggy) and it has been fixed in in de dotCMS trunk! Great work!
>
> Now one of my CSS designers asked if it was possible to seperate my own
> specified class and the currentLevel as 2 different classes?
>
> #set($firstItemClass = "firstItem")
> #set($lastItemClass = "lastItem")
> #navigation(2 2)
>
> This now generates:
>
> <ul>
> <li><a class="firstItem_1" href="/whoarewe/news.dot">News</a></li>
> <li><a href="/whoarewe/management.dot">Management</a></li>
> <li><a class="lastItem_1" href="/whoarewe/guests.dot">Guests</a></li>
> </ul>
>
> where _1 is appended because the current menu level. Now the question I
> got was to indicate my own class to be seperated from the currentLevel.
> E.g.
>
> #set($seperateLevel = true)
> #set($firstItemClass = "firstItem")
> #set($lastItemClass = "lastItem")
> #navigation(2 2)
>
> This could generate:
>
> <ul>
> <li><a class="firstItem level_1" href="/whoarewe/news.dot">News</a></li>
> <li><a href="/whoarewe/management.dot">Management</a></li>
> <li><a class="lastItem level_1"
> href="/whoarewe/guests.dot">Guests</a></li>
> </ul>
>
> where the current level is seperated, as "level_xx", from my own
> "firstItem".
>
> Ot maybe there's a way to leave out the current level e.g.
> #set($skipLevel = true) or something which will omit the _xx after each
> class.
>
> In both way we can use "firstItem" correctly as a seperate CSS class
> selector and - if the level is present - do different things for
> different levels. E.g.
>
> .firstItem {
> border-top: 1px solid black;
> }
>
> .firstItem .level_1 {
> color: red;
> }
>
> If seperating or omitting the level is currently not possible, I'd be
> happy to add both as two seperate improvements in JIRA.
>
> Regards,
> Ted
>  
>



--
Maria Ahues Bouza
Project Manager, dotCMS Services & Support

www.dotmarketing.com
www.dotcms.org
T: 305.858.1422 x (9) 272
D: 786.594.5272
F: 786.594.5288