Support Tickets - CMS - sidebar in Plugins template

CMS - sidebar in Plugins template

CMS 09.10.2016 109 Support Status: Closed Solution: No bluesatkv

Hi Jerome,

I want to find a solution for using sidebar.php in plugins template.

For example:

Now we have only one blogsidebar.php for plugin Blog. I think that is better use sidebar.php in plugin template e.g. folder jakweb,mosaic for other modifications.

I found one solution in sidebar.php in template/jakweb

 if (isset($JAK_HOOK_SIDE_GRID) && is_array($JAK_HOOK_SIDE_GRID)) foreach($JAK_HOOK_SIDE_GRID as $sg) {
if (isset($JAK_HOOK_SIDEBAR) && is_array($JAK_HOOK_SIDEBAR)) foreach($JAK_HOOK_SIDEBAR as $hs) {
if ($hs["id"] == $sg["hookid"]) {
$text = str_replace("' . site_style . '",$jkv["sitestyle"],$hs["phpcode"]);
if (file_exists($text)) {
include_once $text;
} else {
$text = str_replace("' . site_style . '",'',$hs["phpcode"]);
include_once $text;

} } } ?>

and for plugin/blog/install.php change value for Blog Sidebar Category to

(NULL, "tpl_sidebar", "Blog Sidebar Categories", "plugins/blog/template/' . site_style . '/blogsidebar.php", "blog", 1, 4, "' . $rows['id'] . '", NOW()),

text ' site_style' serves as auxiliary text.

but exist better solution. I'm not good coder :-)

You can add solution for using sidebar in plugins from each template, please ?


Sign in to see the solution.