Topic Closed
mabu
261 Posts
3.1K Downloads
3 Themes
8 Plugins

I am looking for a solution to add a specific class to each li-Element in the Pagemanger.

My proposal is to add this possibility under 'More options'.

nth-child and nth-type are possibilities - but if the tree is changed then the css has to be changed as well

3 years ago#10044

juergen
1.5K Posts
54.4K Downloads
16 Plugins
design, web development & visual effects

Hooking into Typesetter's menu rendering is tricky. I tried once but couldn't find a good solution at plugin level.
Your proposal to define additional CSS classes in More Options is a good idea. Let's keep it in mind but I fear there will not be a solution short-term.

nth-child actually is no good solution for your mentioned reasons but you can  ...

1) target the anchor inside the li using

.navbar-nav a[title="Child Page"] {
  /* some styles */
}

or

2) use javascript to add classes to the parent li using the same selection method by adding sth. like th following to template.php:

<?php
$page->jQueryCode .= '
$(".navbar-nav a[title=\'Home\']").closest("li").addClass("home-class");
$(".navbar-nav a[title=\'Child Page\']").closest("li").addClass("childpage-class");
/*...*/
';
?>

While using JS is not exactly beautiful and editing template.php for this purpose is cumbersome, it will work.

Edited: 3 years ago#10047

Topic Closed

 

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register