[Solved]How/where do I assign a variable used by a template?
Posted: Sat Jan 14, 2012 6:26 pm
Thoroughly newbie question, but I can't find it in the handbook, or the Smarty web site or searching all over these discussions.
If you look at the Gallery templates, they test to see if $hideparentlink is set.
How do I set that for a specific page?
I have tried all sorts of variations on setting that in different locations but none have been successful.
I created a new content page and simply put this in the content text box:
{Gallery dir="../Favorites"}
That correctly builds a page showing the thumbnails of my gallery folder containing my favorite photos. But it also contains the up arrow link to go up in the Gallery folder hierarchy.
Examining the template I see that it only includes that up arrow only
{if !$hideparentlink && !empty($parentlink)}
so in the page content for my favorites page I want to set the value of hideparentlink.
Since I couldn't find documentation covering this I have tried:
{Gallery dir="../Favorites" hideparentlink=1}
{Gallery dir="../Favorites" hideparentlink="1"}
{Gallery dir="../Favorites" hideparentlink="True"}
{Gallery dir="../Favorites" hideparentlink="true"}
and then I saw somewhere that you can assign variables, so I tried this:
{Gallery dir="../Favorites"}
{assign var="hideparentlink" value="1"}
and
{Gallery dir="../Favorites"}
{assign var="hideparentlink" value=1}
and just in case what's really being tested is the high-order bit:
{Gallery dir="../Favorites" hideparentlink=-1}
and
{Gallery dir="../Favorites"}
{assign var="hideparentlink" value="-1"}
and
{Gallery dir="../Favorites"}
{assign var="hideparentlink" value=-1}
So figuring you don't do that in content area I also switched over to the options tab and tried similar variations in the "Smarty data or logic that is specific to this page"
And so I'm posting in this area of the forums because while my use is in Gallery, I think this is not a Gallery issue but an area what the User Handbook would categorize under "I Am An Editor"
If you look at the Gallery templates, they test to see if $hideparentlink is set.
How do I set that for a specific page?
I have tried all sorts of variations on setting that in different locations but none have been successful.
I created a new content page and simply put this in the content text box:
{Gallery dir="../Favorites"}
That correctly builds a page showing the thumbnails of my gallery folder containing my favorite photos. But it also contains the up arrow link to go up in the Gallery folder hierarchy.
Examining the template I see that it only includes that up arrow only
{if !$hideparentlink && !empty($parentlink)}
so in the page content for my favorites page I want to set the value of hideparentlink.
Since I couldn't find documentation covering this I have tried:
{Gallery dir="../Favorites" hideparentlink=1}
{Gallery dir="../Favorites" hideparentlink="1"}
{Gallery dir="../Favorites" hideparentlink="True"}
{Gallery dir="../Favorites" hideparentlink="true"}
and then I saw somewhere that you can assign variables, so I tried this:
{Gallery dir="../Favorites"}
{assign var="hideparentlink" value="1"}
and
{Gallery dir="../Favorites"}
{assign var="hideparentlink" value=1}
and just in case what's really being tested is the high-order bit:
{Gallery dir="../Favorites" hideparentlink=-1}
and
{Gallery dir="../Favorites"}
{assign var="hideparentlink" value="-1"}
and
{Gallery dir="../Favorites"}
{assign var="hideparentlink" value=-1}
So figuring you don't do that in content area I also switched over to the options tab and tried similar variations in the "Smarty data or logic that is specific to this page"
And so I'm posting in this area of the forums because while my use is in Gallery, I think this is not a Gallery issue but an area what the User Handbook would categorize under "I Am An Editor"