Here are a couple questions that need to be answered before I can decide what to recommend.
1. Are you making this template for a particular store or are you trying to make it generic so it would work on any store?
2. Will you always have link graphics for every page?
3. Will you always have link text for every page?
4. Do you want to display just the link graphic if it exists or do you need to display the Link Text and link graphic.
5. Did you make the changes exactly as I specified?
6. In the [-- LINK --] tag was there a template name specified? If so did you change that to match the name of the template you are modifying?
7. Did you change all your pages to use your modified template?
To test and see if this would actually work I added the code I mentioned previously to a copy of the awesome_orange_001_pa_template.sst page template which I called "awe". (Your store page was using the awesome orange template when I looked at it so I assume that is where you got the code you posted.)
I modifed the [-- DEFINE LINK_TO_PAGE --] in two places (at the top)
- Code: Select all
[-- DEFINE LINK_TO_PAGE --]
[-- VAR.link_made "no" --]
to
- Code: Select all
[-- DEFINE LINK_TO_PAGE --]
[-- if VAR.pagename page.name --]
<a href="[-- OUTPUT_DIRECTORY_URL --]/[-- PAGE.FileName --]" <img src="[-- OUTPUT_DIRECTORY_URL --]/media/[-- page.field1 --]" alt="is my test working" border="5" hspace="3" vspace="3" ><br>
[-- VAR.link_made "yes" --]
[-- else --]
[-- VAR.link_made "no" --]
and at the bottom of the [-- DEFINE LINK_TO_PAGE --]
- Code: Select all
[-- END_IF --]
[-- END_DEFINE LINK_TO_PAGE --]
to
- Code: Select all
[-- END_IF --]
[-- end_if --]
[-- END_DEFINE LINK_TO_PAGE --]
I modified the [-- DEFINE PAGE --] section of the template around the Loop Links section from
- Code: Select all
[-- LOOP LINKS 1 --]
<td class="menu_button"><table class="menu_button">
<tr class="menu_button_row_1">
<td class="menu_button_1a"></td>
<td class="menu_button_1b"></td>
<td class="menu_button_1c"></td>
</tr>
<tr class="menu_button_row_2">
<td class="menu_button_2a"></td>
<td class="menu_button_content">[-- LINK awesome_orange_001_pa_template.sst --]</td>
<td class="menu_button_2c"></td>
</tr>
<tr class="menu_button_row_3">
<td class="menu_button_3a"></td>
<td class="menu_button_3b"></td>
<td class="menu_button_3c"></td>
</tr>
</table></td>
[-- END_LOOP LINKS --]
to
- Code: Select all
[-- VAR.pagename page.name --]
[-- LOOP LINKS 1 --]
<td class="menu_button"><table class="menu_button">
<tr class="menu_button_row_1">
<td class="menu_button_1a"></td>
<td class="menu_button_1b"></td>
<td class="menu_button_1c"></td>
</tr>
<tr class="menu_button_row_2">
<td class="menu_button_2a"></td>
<td class="menu_button_content">[-- LINK awe --]</td>
<td class="menu_button_2c"></td>
</tr>
<tr class="menu_button_row_3">
<td class="menu_button_3a"></td>
<td class="menu_button_3b"></td>
<td class="menu_button_3c"></td>
</tr>
</table></td>
[-- END_LOOP LINKS --]
I added the name of my "glowing" image to the page field 1 field for the various pages.
Using the Power Edit feature I changed all pages to use the new "awe" template. I also made sure that the page was assigned to itself so a link to the page would be included on the page.
I published and things worked as I expected, When I was on a page, that page's link image was the one set in the page field1 area and when I was on a different page the link image was the one defined in the Link Graphic: section.