While building the navigation of a site, I find that it is sometimes quite difficult to give the active pagename in the menu some special styling.
Usually you would add a styling. But in CMSimple it's different, as all pages are links and the active page is no link. Links css goes on top of basic css styling. So to style the active pagename you have to style the basic entry and to style the non active page names, you have to add css styling top of it the basic entries.
This is kind of upside down.
Wouldn't it be easier to have an additional class="active" for the active page? Wouldn't break any old templates.
class="active" in toc() for the active page
Re: class="active" in toc() for the active page
Hm, the active page has the class .sdoc resp. .sdocs since early versions of CMSimple.
Furthermore the active page is wrapped in a <span> (see http://cmsimpleforum.com/viewtopic.php?f=29&t=5364) in XH 1.6 and in CMSimple 4(.?), so this could be used alternatively (something like .menulevel span).
Furthermore the active page is wrapped in a <span> (see http://cmsimpleforum.com/viewtopic.php?f=29&t=5364) in XH 1.6 and in CMSimple 4(.?), so this could be used alternatively (something like .menulevel span).
Christoph M. Becker – Plugins for CMSimple_XH
Re: class="active" in toc() for the active page
Oops, I think I still have to learn a lot.
svasti
svasti
Re: class="active" in toc() for the active page
which can be quite tricky, consider:cmb wrote:the active page has the class .sdoc resp. .sdocs since early versions of CMSimple
A level 2 page is selected: it got class="sdocs", but its parent page also has "sdocs" if parent is selected in config,
and all subpages inherit "sdocs" as they are inside the same <li>.
I overlooked this. It's manu's suggestion, a great idea, as this doesn't inherit. It will make designing interesting menus easier. Why haven't we put it into 1.5.9?cmb wrote:the active page is wrapped in a <span> ... in XH 1.6
By the way, what could (s)doc(s) mean? (selected) document (with sequence)? Sometimes I find the abbreviated variable names quite cryptic.
Re: class="active" in toc() for the active page
Yes, but the subpages are on another level, so you can distinguish them (requires more style rules, though).svasti wrote:A level 2 page is selected: it got class="sdocs", but its parent page also has "sdocs" if parent is selected in config,
and all subpages inherit "sdocs" as they are inside the same <li>.
Nobody has suggested to do so. And actually, I'm not sure if that small change might break some templates.svasti wrote:I overlooked this. It's manu's suggestion, a great idea, as this doesn't inherit. It will make designing interesting menus easier. Why haven't we put it into 1.5.9?
Indeed, the identifiers used in CMSimple are most often overly terse. I assume that the prefix "s" often means "selected" (as in $s, $su, $sl etc.; cf. $selected), and that "doc" means a single document, and "docs" (plural) means multiple documents.svasti wrote:By the way, what could (s)doc(s) mean? (selected) document (with sequence)? Sometimes I find the abbreviated variable names quite cryptic.
Christoph M. Becker – Plugins for CMSimple_XH