{$theme.item.title|markup:strip} in lowercase + navigate link?

schlimmest

Joined: 2007-01-20
Posts: 15
Posted: Sat, 2007-01-20 20:40

Hi,
I'm trying to outprint navigation links i lcase like this,
/gallery/
/gallery/album/
/gallery/album/subalbum/
/gallery/album/subalbum/picture.jpg

in other words, just print out, what "level" the user is at the momement when he navigates through the pictures..

I'd love to get this all in lowercase. + that each of the outprints become links, so the user can navigate back and forward in the gallerys through them...

I've tried something under :)
What am i missing?

Quote:
{if !empty($theme.item.title)}
{if $theme.pageType == 'photo'}
{$theme.item.title|markup:strip}/{$theme.parent.title|markup:strip}/<b>{$theme.item.pathComponent|markup:strip}</b>
{else}
{$theme.parent.title|markup:strip}/<b>{$theme.item.title|markup|default:$theme.item.pathComponent|markup:strip}</b>
{/if}
{/if}

Thanks :)
schlimmest.

 
joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Sat, 2007-01-20 22:05

Isn't what you want a breadcrumb exactly? (just in lowercase)
check out ~modules/core/templates/breadcrumb.tpl (somewhere in there :) )

My Gallery 2: http://gallery.site.hu

 
schlimmest

Joined: 2007-01-20
Posts: 15
Posted: Sat, 2007-01-20 22:31

AWSOME :)
Thanks.
Now, just to get this code in lowercase + outprint like
/album/subalbum/picture.jpg

not like it is now:
/ album / subalbum / picture.jpg

Quote:
{section name=parent loop=$theme.parents}
{if !$smarty.section.parent.last}
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.parents[parent].id`"
arg3="highlightId=`$theme.parents[parent.index_next].id`"}"
class="BreadCrumb-{counter name="BreadCrumb"}">
{$theme.parents[parent].title|default:$theme.parents[parent].pathComponent|markup:strip}</a>
{else}
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.parents[parent].id`"
arg3="highlightId=`$theme.item.id`"}"
class="BreadCrumb-{counter name="BreadCrumb"}">
{$theme.parents[parent].title|default:$theme.parents[parent].pathComponent|markup:strip}</a>
{/if}
{if isset($separator)} {$separator} {/if}
{/section}

{if ($theme.pageType == 'admin' || $theme.pageType == 'module')}
<a href="{g->url arg1="view=core.ShowItem"
arg2="itemId=`$theme.item.id`"}" class="BreadCrumb-{counter name="BreadCrumb"}">
{$theme.item.title|default:$theme.item.pathComponent|markup:strip}</a>
{else}
<span class="BreadCrumb-{counter name="BreadCrumb"}">
{$theme.item.title|default:$theme.item.pathComponent|markup:strip}</span>
{/if}

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2007-01-21 02:26

@ space: {if isset($separator)} {$separator} {/if}
@ lowercase: http://smarty.php.net/manual/en/language.modifier.lower.php

Dave
_____________________________________________
Blog & G2 || floridave @ Gallery Team || G2 Theme Contest: +$3k in Prizes!

 
joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Sun, 2007-01-21 04:14

as this is smarty, I think |strtolower will just convert it to lowercase

 
schlimmest

Joined: 2007-01-20
Posts: 15
Posted: Sun, 2007-01-21 10:38

|strtolower works great, thanks joe7rocks! :)

But as for the spacing, it dont work totally.
Now it looks like this
/pictures /paris /img_1631.jpg

so, i'm struggeling removing the space _after_ the name..
I'd like for it to be
/pictures/paris/img_1631.jpg

Quote:
{section name=parent loop=$theme.parents}{if !$smarty.section.parent.last}/<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.parents[parent].id`"
arg3="highlightId=`$theme.parents[parent.index_next].id`"}"
class="BreadCrumb-{counter name="BreadCrumb"}">{$theme.parents[parent].title|strtolower|default:$theme.parents[parent].pathComponent|strtolower|markup:strip}</a>
{else}/<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.parents[parent].id`"
arg3="highlightId=`$theme.item.id`"}"
class="BreadCrumb-{counter name="BreadCrumb"}">{$theme.parents[parent].title|strtolower|default:$theme.parents[parent].pathComponent|strtolower|markup:strip}</a>
{/if}

{/section}
{if ($theme.pageType == 'admin' || $theme.pageType == 'module')}
/<a href="{g->url arg1="view=core.ShowItem"
arg2="itemId=`$theme.item.id`"}" class="BreadCrumb-{counter name="BreadCrumb"}">{$theme.item.title|strtolower|default:$theme.item.pathComponent|strtolower|markup:strip}</a>
{else}
<span class="BreadCrumb-{counter name="BreadCrumb"}">/<b>{$theme.item.title|strtolower|default:$theme.item.pathComponent|strtolower|markup:strip}</b></span>
{/if}