Dave, horizontal menu please
chiste
Joined: 2008-05-15
Posts: 12 |
Posted: Tue, 2008-06-03 05:18 |
I'm creating a custom theme with an horizontal navitagion to the main albums. To acompish this I have tried to different approches, but none works Fisrt I tried an unsorted list of the theme children: <ul id="navigation" class="navigation" > {foreach from=$theme.children item=child} {capture assign=linkUrl}{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}{/capture} <li><a href="{$linkUrl}" > {if !empty($child.title)} {$child.title|markup} {/if} </a></li> {/foreach} </ul> Next I tried a Peer List Block <div id="navigation" class="navigation" > {g->block type="core.PeerList"} </div> The problem is that in both casses, the naviation items change as the user goes deep into the sub items the album. More information on my previous post Here is an image of my theme CHEFS, RESTAURANTES, PLATOS, INSUMOS and REPORTAJES are the main album names and I want my navigation bar to keap those links permantly. Please help. Look at my site at Chiste |
|
Posts: 27300
So you only want to show the root albums only?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 12
Yes, please. I dont what to hard-code them in case I change or ad one
Posts: 27300
You will need to have the album select module activated but not necessarily used
You will have to change the id of the unordered list and well as add a ID to the list item if needed for css
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 12
Thanks Dave, that was exactly what I was looking for. Maybe you can help with one more thing. I need to check a seccond condition to know the current album to add a css class
Posts: 27300
{if $theme.item.title == $data.titles[$node.id]}same{/if}
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 12
Thanks again Dave. It worked beautifully. How ever, when you click on an album image or subalbum, it no longer work. Obviously it its because the clicked item has a different title. Please take a look at my site to see what I'm taking about.
http://photosgourmetperu.com/gallery2/
This is how I implement your code
Posts: 27300
I guess you need to detect if you are on a photo page and then check the parent of the photo to see if it is the current.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 1
Love the horizontal bar. it worked great for me, but seem to have the same problem as chiste. The titles are to blame, but would not have been able to do this without you so I am kind of stuck.
Posts: 27300
I don't understand the issue. Is the title of the root album not a link? is it possibly to long and gets truncated?
The link you provided I don't see a gallery2 install.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 1
Thank-you for this. I like the horizontal bars much better thent he standard vertical ones. It makes it look more professional and different so thank-you.
Pat.R
Posts: 12
Floridave
I'm affraid that this forum is being a victim of spam. Last 3 posts make no sense. Just look at "epilare" link. I recomend to implement some kind of captcha to post a new comment.
Chiste
Posts: 16504
Christe,
We actually don't have that big of a problem with spam in the forums. When you see it you can click mark as spam, that will flag the message. Also, when we these messages, the moderators can also remove the post and block the users.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here