Гость
08 Окт 2013 05:49

I seem to have trouble overriding some of the templates, for example when editing a plan template, it shows the following:

$layout = new JLayoutFile('buttons', $basePath = JPATH_COMPONENT .'/layouts');

but it seems that it points directly to the core template of emerald so that overrides made in /templates/xxtemplate_namexxx/html/com_emerald/layouts/buttons.php is bypassed.

Is there something I'm doing wrong? How can I edit this template without it being replaced with next emerald update?

Последние изменения: 02 Март 2014


Konstantin
Total posts: 1,113
09 Окт 2013 00:45

You can override template 'buttons'. Just copy it in this palce

templates\protostar\html\layouts\buttons.php

and than customize.


Гость
09 Окт 2013 05:47

Great, that worked!

What about how to override /components/com_emerald/views/rules/tmpl/default.php?

As far as I see this template gets called by calling the echo EmeraldRulesHelper::rules_form() function.

But this function doesn't take overrides in /templates/your_template/html/com_emerald/rules into account.

How can I do to override this template?


Konstantin
Total posts: 1,113
09 Окт 2013 07:58

You can't override this template.


Sergey
Total posts: 13,748
09 Окт 2013 23:24

It does no override and I do not know why. Because it uses native Joomla 3 MVC pattern to load view. It should override.

But this is part of administrative interface. YOu can just leave it as it is because regular users will not be able to access it.


Гость
10 Окт 2013 04:49

In the end I managed to override it by making a change in components/com_emerald/helpers/actions.php :

$paths->insert(JPATH_ROOT . '/templates/mytemplate/html/com_emerald/actions', 'normal');

//$paths->insert(JPATH_ROOT . '/components/com_emerald/views/actions/tmpl', 'normal');

and in components/com_emerald/helpers/rules.php :

$paths->insert(JPATH_ROOT . '/templates/mytemplate/html/com_emerald/rules', 'normal');

//$paths->insert(JPATH_ROOT . '/components/com_emerald/views/rules/tmpl', 'normal');

And adding the overrides in /templates/mytemplate/html/com_emerald

Not a very elegant solution because an update to emerald will revert it, but I really needed to override this template, I would love to see this template adhere to Joomla 3 MVC pattern so that this change is not needed in the future


Sergey
Total posts: 13,748
10 Окт 2013 06:12

Fixed in upcoming release today.

Работает на Cobalt