Announcement

#1 2013-10-01 13:59:55

faq
Member
2013-06-03
16

Category listing on custom location

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

 

#2 2013-10-01 15:22:01

flop25
Piwigo Team
2006-07-06
7037

Re: Category listing on custom location

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


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2013-10-01 17:59:56

faq
Member
2013-06-03
16

Re: Category listing on custom location

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

 

#4 2013-10-01 18:23:44

flop25
Piwigo Team
2006-07-06
7037

Re: Category listing on custom location

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...


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2013-10-01 18:35:06

faq
Member
2013-06-03
16

Re: Category listing on custom location

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

 

#6 2013-10-01 18:49:05

flop25
Piwigo Team
2006-07-06
7037

Re: Category listing on custom location

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


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#7 2013-10-02 05:53:34

faq
Member
2013-06-03
16

Re: Category listing on custom location

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

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact