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"
[Solved]How/where do I assign a variable used by a template?
[Solved]How/where do I assign a variable used by a template?
Last edited by tobinjim on Sun Jan 15, 2012 11:09 pm, edited 1 time in total.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: How/where do I assign a variable used by a template?
You were close. You are currently assigning the variable AFTER the gallery module has done its stuff and the output has been displayed (which would do nothing).
Try this:
Try this:
Code: Select all
{assign var="hideparentlink" value=1}
{Gallery dir="../Favorites"}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: How/where do I assign a variable used by a template?
Thanks CalGuy1000. That makes perfect sense. But it didn't work on my page.
For absolute clarity, I log into the admin side of the CMS Made Simple interface. I hovered over the Content menu, and clicked on Pages submenu. In the resulting "Current Pages" table I clicked the hyperlink for the Page (in my case, this is the first submenu on the second main menu, so 2.1 _Favorite Photos_) This brings me to the "Edit Content" page where in the "Content*:" text box I have just:
{assign var="hideparentlink" value=1}
{Gallery dir="../Favorites"}
And to abide by some of the forum rules:
CMS Made Simple 1.10.3
Gallery 1.4.4
Template: CMS-Times : The CMS-Times
Gallery Template: Thickbox 3.1-3
(I realize why we list all this. Just know that I downloaded all of this two days ago
For absolute clarity, I log into the admin side of the CMS Made Simple interface. I hovered over the Content menu, and clicked on Pages submenu. In the resulting "Current Pages" table I clicked the hyperlink for the Page (in my case, this is the first submenu on the second main menu, so 2.1 _Favorite Photos_) This brings me to the "Edit Content" page where in the "Content*:" text box I have just:
{assign var="hideparentlink" value=1}
{Gallery dir="../Favorites"}
And to abide by some of the forum rules:
CMS Made Simple 1.10.3
Gallery 1.4.4
Template: CMS-Times : The CMS-Times
Gallery Template: Thickbox 3.1-3
(I realize why we list all this. Just know that I downloaded all of this two days ago

Re: How/where do I assign a variable used by a template?
Facepalm.... right on the Content >> Gallery page there is a checkbox for "Hide link to parent gallery"
Forrest... trees...
Forrest... trees...