Manager Theme Customization problem

Hello,
i want to change the manager theme, and i change only header.tpl and introduce mycss.css (insert to header).

I created a new directory (mytheme) inside the template manager and inserted the modified (header.tpl) and added (css/mycss.css) files, after i change manager_theme settings to mytheme, as the guide says (i’m on 3.x version)
https://docs.modx.com/3.x/en/building-sites/client-proofing/custom-manager-themes
For to work, however, I have to copy the entire default folder into mytheme folder and then replace the custom files (header.tpl)
Is this okay?
I understood that it was enough to copy only the modified files

@SilverMabol do you really need a copy? I change the manager theme with a simple plugin.

Plugin: MODX-Gitify-Preset/_gitify/plugins/managerModify.php at bac51dec4ca3b008ddc17f4f580eb2e4711b5ef9 · jenswittmann/MODX-Gitify-Preset · GitHub
CSS: CurlyFramework/dev/css/modx.scss at a1545d03ec17c95085190e006ab0ebcf64558aed · jenswittmann/CurlyFramework · GitHub

Many thanks but I would like to understand if I have to copy the entire folder or I have a problem :grinning:

I did a test and it seems to work, when I only copy the file “header.tpl” to its own directory (and change its content).

(The only issue I see, is that the MODX logo in the manager (modx-icon-color.svg) and the photography on the log-in screen aren’t visible anymore.)

I solved this even if it contradicts the linked guide.
But
in fresh install with no change, no extra, nothing. If i change theme only width header.tpl in new cuatom folder, this is the result


i’ve deleted manualy core/cache

Before i change theme is it all ok

In browser console no error (only modx-icon-color.svg not found)
In modx error.log this:
[2025-01-29 16:10:16] (ERROR @ C:\wamp64\www\1modx310puro\core\src\Revolution\Smarty\modSmarty.php : 160) Unable to load template ‘file:dashboard/buttons.tpl
[2025-01-29 16:10:16] (ERROR @ C:\wamp64\www\1modx310puro\core\src\Revolution\Smarty\modSmarty.php : 160) Unable to load template ‘file:dashboard/configcheck.tpl
[2025-01-29 16:10:16] (ERROR @ C:\wamp64\www\1modx310puro\core\src\Revolution\Smarty\modSmarty.php : 160) Unable to load template ‘file:dashboard/updates.tpl
[2025-01-29 16:10:16] (ERROR @ C:\wamp64\www\1modx310puro\core\src\Revolution\Smarty\modSmarty.php : 160) Unable to load template ‘file:dashboard/onlineusers.tpl
[2025-01-29 16:10:16] (ERROR @ C:\wamp64\www\1modx310puro\core\src\Revolution\Smarty\modSmarty.php : 160) Unable to load template ‘file:dashboard/recentlyeditedresources.tpl

I created a pull request on Github that should solve the issue with the missing dashboard widgets and get rid of these error messages:

1 Like

@SilverMabol and @jenswittmann can you folks test @halftrainedharry’s changes out and comment in the PR about your findings and perhaps share how you tested? Fallback for dashboard widgets in custom manager theme by halftrainedharry · Pull Request #16705 · modxcms/revolution · GitHub

That would help us get it tested and merged for the next release we’re hoping to have out this coming week, if possible. :slight_smile:

@smashingred and @halftrainedharry works for me! Thanks.

2 Likes

For me it’s ok.
The problem of the logo in the manager remains.
In header.tpl, on line 98 (<img src="{$_config.manager_url}templates/{$_config.manager_theme}/images/modx-icon-color.svg" title="{$_config.site_name|strip_tags|escape}">) it would be enough to check if it exists or put the default one, or something similar.
In login i don’t have problema.
I have no problems login.tplin even though @ halftrainedharry mentioned some

Thanks for testing Jens. Much appreciated.

This is the only case where anything in the CMS has ever referenced the $_config.manager_theme in a path that I can find. In 2.x it was a background image:

<li id="modx-home-dashboard">
    <a href="?" title="MODX {$_config.settings_version}({$_config.settings_distro})
    {$_lang.dashboard}">{$_lang.dashboard}</a>
</li>
#modx-navbar #modx-home-dashboard {
  background-image: url("../images/modx-icon-color.png");
  background-image: url("../images/modx-icon-color.svg"), none;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: 40px 40px;
  width: 50px;
  border-right: none;
  margin-left: 21px;
  image-rendering: optimizequality; }

The change appears to have been here: - New navigation bar · modxcms/revolution@ad45612 · GitHub You can go to line #43 in header.tpl to see where it was introduced.

I’m not sure the best way to have a theme fallback here. Smarty and defaults are not something I’m familiar with. I don’t know if it would work anyway since the custom theme value will be not NULL and as such the variable will have a value. I feel there must be a reference to the Manager Theme globally and those themes should derive the structure from that.

It feels like the answer may lie in here somewhere: revolution/core/src/Revolution/modManagerRequest.php at db98407a2a6f29f66ef277b82ff9d54749c1610e · modxcms/revolution · GitHub or Code search results · GitHub or Code search results · GitHub

If I understand what you mean, you are completely right.
But if you want to quickly move on to 3.1.1., here, just for an src link, one “if” may be fine.
Or change the guide, inserting to also copy “templates/default/images/modx-icon-color.svg” in new custon theme, to avoid creating misunderstandings.

You’d have to check in the code here

if the logo is available in the custom manager theme directory and then set a placeholder (with $this->setPlaceholder() and use a variable in the Smarty template instead of using {$_config.manager_url}templates/{$_config.manager_theme}/images/modx-icon-color.svg:


On the manager login page, there is a similar problem with the MODX logo here

and the background image (4 lines above), where you had to check the availability of these images in the custom manager theme folder.


These are more code changes than I’m personally willing to make. So I did not include this in my PR (which only deals with the dashboard widgets).

I’d suggest copying the images to your custom manager theme folder, using custom images or just changing header.tpl and login.tpl in your custom manager theme.

Yes, i see, the problem in login page, sorry.
In my custom manager theme add the folder
custom/images/
widh
modx-logo-color.svg
and
login/default-background.jpg
and all in login and dashboard it’s ok.
Thank’s

Could there be problems with the other images in the folder images (are there really many)?
Otherwise I copy it all into my theme folder