Greets.
I amI am trying to display categories on a custom location,
my approach is, I made a new file named customcats.tpl and kept it in theme/mytheme/template folder.
then I copied the code from menubar_categories file (default theme) and pasted in above file
then I included this file on a custom header position, but nothing happens, it does not display any category.
any suggestions?
(NB: I don’t want to use any plug-in for this but just need the code)
BR/FAQ
Offline
Hello
Could you be more specific? What is for you "custom location " " I included this file on a custom header position"
Just explain exactly what you want and what you did. Thx
Offline
thank you flop for your reply,
specifically, I am trying to implement bootstrap 3 fixed navbar with categories as a dropdown menu in header section.
For this purpose I need raw output of categories in <ul> <li> </li></ul> style.
appreciate your help
regards
FAQ
Offline
ok thx!
Piwigo loads the tpl files from theme/mytheme/template, but only the files with a right name
You can use smarty tags to include other tpl files, but you need to set the variables
In your case, the variables from the menu are not initialized outside of their original file, they have no existences.
don't know if can parse after smarty the html code to move the menu...
Offline
thankyou flop for the explanation.
so in your opinion, what is the best solution for this? beside, what is the way register a new file which is not part of existing template file
BR/FAQ
Offline
that's quite touchy, because the menu generation is one the most resource/time consuming for php/smarty
you should call for the functions generating the menu tree from your themeconf.php and then set the variables in your custom header.tpl
Offline
Thanks Flop.
since I am not very familar with smarty,
using below code, would it be possible to get the raw data
<code>
{foreach from=$blocks key=id item=block}
<span id="{$id}" >
<li class="liSub">
{if not empty($block->template)}
{include file=$block->template|@get_extent:$id }
{else}
{$block->raw_content}
{/if}
</li>
</span>
{/foreach}
</code>
Thanks
Offline