Skip to content

Instantly share code, notes, and snippets.

@pmfx
Last active March 10, 2019 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pmfx/4cf52f5bc194f5b2cb9f6f4f52674df5 to your computer and use it in GitHub Desktop.
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.
<?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);
}
@pmfx
Copy link
Author

pmfx commented Feb 26, 2019

2019-02-26-21-11-38

2019-02-26-21-11-59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment