Last active
March 10, 2019 11:42
-
-
Save pmfx/4cf52f5bc194f5b2cb9f6f4f52674df5 to your computer and use it in GitHub Desktop.
Plugin for Evolution CMS. Adds some style to the first level tree elements, to make them stand out more. Usefull when you are using first level documents as "context" folders.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ManagerCssContexts | |
// Add some style too the first level tree elements. | |
// Event: OnManagerTreePrerender | |
// Modify $contexts variable for your needs. | |
$e = & $modx->Event; | |
if ( $e->name == "OnManagerTreePrerender" ) { | |
$contexts = 10; | |
$html = ' | |
<style> | |
#treeRoot > div:nth-child(-n+'.$contexts.') > .node { | |
padding-top: 5px; | |
padding-bottom: 5px; | |
background-color: rgba(0,0,0,0.03) !important; | |
} | |
#treeRoot > div:nth-child(-n+'.$contexts.') > div { | |
padding-top: 5px; | |
padding-bottom: 5px; | |
} | |
.dark #treeRoot > div:nth-child(-n+'.$contexts.') > .node, | |
.darkness #treeRoot > div:nth-child(-n+'.$contexts.') > .node { | |
background-color: rgba(255,255,255,0.05) !important; | |
} | |
</style> | |
'; | |
$e->output($html); | |
} |
Author
pmfx
commented
Feb 26, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment