Open Jimmi08 opened 4 years ago
It looks like related to this: https://github.com/e107inc/e107/issues/4057
You shouldn't use ParseTemplate() in magical shortcodes.
@Jimmi08 I was able to use parseTemplate() inside the footer magic shortcode, so it must be caused by something else.
/**
* Special Footer Shortcode for dynamic menuarea templates.
* @shortcode {---FOOTER---}
* @return string
*/
function sc_footer()
{
$template = "<div class='text-center'>Hello {SITENAME}</div>";
return e107::getParser()->parseTemplate($template, true);
}
@CaMer0n I know where is problem. You tried something else than me. I have a problem with footer menus.
function sc_footer()
{
$template = "<div class='text-center'>Hello {SITENAME} {MENU=101}</div>";
return e107::getParser()->parseTemplate($template, true);
}
You will see that the menu area is not displayed in the layout preview... Neither in the menu manager.
Just recapitulation:
When you have only one footer, you put it directly in theme.html When you have one footer for layout, you can put it in layout html files.
But when you want to let user decide what footer to use for each layout, then you need custom solution. All footers are in separate files and the user can select one of them.
Normally (before) I had custom theme shortcode for it, like this:
of course, it stopped now to work.
So I changed this shortcode to magical shortcode {---FOOTER---} for variable footers. See description, it is for this purpose now.
This way:
This code breaks Menu manager. It's because of parse template code (but it is needed for Frontend)
After changing
Menus select works. But preview not. Menu is displayed but that blue area is not.
After changing
blue areas are displayed. But it means I can use url parameter configure in future.
Should this work this way? It took me hours to find a working solution because I am not familiar with how the menu manager works.