-
-
Save akool/12e051440eeda2013682078cd83f6c03 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); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment