Announcement

  •  » Themes
  •  » [resolved] Custom header

#16 2010-06-19 22:53:05

developer
Member
Honolulu, HI (United States)
2010-06-19
79

Re: [resolved] Custom header

As for selecting a category, in functions_url file I found similar logic, but couldn't figure out the correct syntactic for selecting specific category, could you give me a hint, please?

Code:

{if ($categories == 'mycategory') } class="tabs-selected"{/if}

400+ Magento Themes, each Magento template includes PSD file. See our gallery!

Offline

 

#17 2010-06-20 13:22:41

flop25
Piwigo Team
2006-07-06
7037

Re: [resolved] Custom header

VDigital wrote:

Could you try $this in state of $template or $smarty?

{php}
global $page;
$this->assign($page['section'], 'tabs-selected');
{/php}

Great job ^^ !

for a specific category it's a bite complexe


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

 

#18 2010-06-21 07:31:49

developer
Member
Honolulu, HI (United States)
2010-06-19
79

Re: [resolved] Custom header

flop, I agree VDigital gave great solution =) Only thing left is to figure out how to do same thing with categories. I am ok hard coding the names, just trying to figure out the syntax.

If you could help, I would appreciate it =)


400+ Magento Themes, each Magento template includes PSD file. See our gallery!

Offline

 

#19 2010-07-02 18:46:16

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: [resolved] Custom header

By example, append to your header.tpl

Code:

{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
{html_head}
<script type="text/javascript">
 $(document).ready(function(){ldelim}
   $("#mbCategories ul li.selected").parent('ul').parent('li').eq(0).addClass('selected'); /* select parent */
   $("#mbCategories ul li.selected").parent('ul').parent('li').eq(0).addClass('selected'); /* select grandparent */
   $("#mbCategories ul li.selected").parent('ul').parent('li').eq(0).addClass('selected'); /* select great-grandparent */
 });
</script>
<style>
#menubar #mbCategories li.selected > a {ldelim} font-weight:bold; }
</style>
{/html_head}

This sets 3 upper-levels in bold.


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#20 2010-07-10 12:24:14

developer
Member
Honolulu, HI (United States)
2010-06-19
79

Re: [resolved] Custom header

{if $cat.SELECTED}class="tabs-selected"{/if}

This is what I was looking for, kinda...it wouldn't work in my case, because I don't call categories as array. =/


400+ Magento Themes, each Magento template includes PSD file. See our gallery!

Offline

 

#21 2010-07-10 13:18:02

flop25
Piwigo Team
2006-07-06
7037

Re: [resolved] Custom header

Do you have a link in order to see what exactly you want for the categories please ? Maybe by private message


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

 

#22 2010-07-10 16:55:19

flop25
Piwigo Team
2006-07-06
7037

Re: [resolved] Custom header

could you try that :

{php}
$findme   = 'premium';
$pos = strpos($_SERVER["REQUEST_URI"], $findme);

if ($pos !== false) {
    $this->assign('premium_tab', 'tabs-selected');;
}

[repeat for other tabs]

{/php}

and then as usual

{if isset ($premium_tab) } class="{$premium_tab}" {/if}


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

 

#23 2010-07-10 22:21:39

developer
Member
Honolulu, HI (United States)
2010-06-19
79

Re: [resolved] Custom header

flop25,

Thank you very much! It worked perfectly!


400+ Magento Themes, each Magento template includes PSD file. See our gallery!

Offline

 

#24 2010-07-11 13:14:27

flop25
Piwigo Team
2006-07-06
7037

Re: [resolved] Custom header

I'm happy to see a user happy ^^
Can I suggest you to improve some details like "if it is home then <div class="content" style="margin-left:0"
Your website is really great Good luck for your business


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

 
  •  » Themes
  •  » [resolved] Custom header

Board footer

Powered by FluxBB

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