Skipping a link during a [-- LOOP LINKS --] operation....

General ShopSite user discussion

Skipping a link during a [-- LOOP LINKS --] operation....

Postby Yachtsman » Sun Jan 03, 2010 2:19 pm

I want to only display certain links during the operation, i.e. only the ones with a link graphic.

It seems to work except I get the work number of columns. I set it for 3 columns but I get 2.

The main code section is:

<table width="100%" align="center" border="[-- VAR.border --]" cellpadding="3">
[-- LOOP LINKS PAGE.Columns --]
[-- LINK YPIPageLinks --]
[-- END_LOOP LINKS --]
</table>

The YPIPageLinks section is:
[--DEFINE LINK_TO_PAGE--]
[-- IF Page.LinkGraphic --]
<td valign="top" align="[-- VAR.align --]">
<a href="[-- OUTPUT_DIRECTORY_URL --]/[-- PAGE.FileName --]">[-- PAGE.LinkGraphic --]</a>
<br><a href="[-- OUTPUT_DIRECTORY_URL --]/[-- PAGE.FileName --]">[-- IF PAGE.LinkName --][-- PAGE.LinkName --][-- ELSE --][-- PAGE.Name --][-- END_IF --]</a>
</td>
[-- END_IF --]
[--END_DEFINE LINK_TO_PAGE--]

Thoughts?
Yachtsman
 
Posts: 24
Joined: Fri Dec 11, 2009 9:21 am
Location: washington

Postby robm » Sun Jan 03, 2010 6:47 pm

Since you're not using every assigned link, you cannot use the built-in column system, as ShopSite does not know what links you want to count.

You would have to add in your own column system such as setting a variable to count columns, then manually set the next row, etc... something like:

Code: Select all
<table width="100%" align="center" border="[-- VAR.border --]" cellpadding="3">
<tr>
[-- VAR.columns 0 --]
[-- LOOP LINKS PAGE.Columns --]
[-- LINK YPIPageLinks --]
[-- END_LOOP LINKS --]
</tr>
</table>


...

Code: Select all
[--DEFINE LINK_TO_PAGE--]
[-- IF Page.LinkGraphic --]
[-- VAR.columns INC --]
[-- IF VAR.columns 4 --]
  </tr><tr>
  [-- VAR.columns 1 --]
[-- END_IF --]
<td valign="top" align="[-- VAR.align --]">
<a href="[-- OUTPUT_DIRECTORY_URL --]/[-- PAGE.FileName --]">[-- PAGE.LinkGraphic --]</a>
<br><a href="[-- OUTPUT_DIRECTORY_URL --]/[-- PAGE.FileName --]">[-- IF PAGE.LinkName --][-- PAGE.LinkName --][-- ELSE --][-- PAGE.Name --][-- END_IF --]</a>
</td>
[-- END_IF --]
[--END_DEFINE LINK_TO_PAGE--]


You'll have to adjust it as needed, but the framework is there...
robm
 
Posts: 463
Joined: Fri Aug 04, 2006 5:46 pm
Location: Connecticut


Return to User Forum

Who is online

Users browsing this forum: No registered users and 118 guests