Issue placing testimonial based on ProductField code

General ShopSite user discussion

Issue placing testimonial based on ProductField code

Postby royhink » Wed Aug 08, 2007 10:28 am

I am working on placing testimonials onto a page based on a "code" I put into PAGE.Field10, and it's not happening.

The idea is to put the testimonial that is relevant to the product line into an INCLUDE file, and place it onto the correct page.

The background graphic is coming thru fine, but not the testimonial.

One issue: I am using nested INCLUDES, but it's not working, even with the PROCESS tag put in. Is it possible to nest INCLUDES? Or do I have a syntax issue?

Any help mucho appreciated.

This is code I've got so far.

<!-- ## DISPLAY BANNER ## -->
[-- IF PAGE.Field10 --]
<tr><td colspan="2" width="600" height="200" align="right" valign="center"
background="media/Banners/[-- PAGE.Field10 --]Banner.jpg">
<!-- ## TESTIMONIAL DISPLAYED OVER BANNER GRAPHIC ## -->
[-- INCLUDE Test_[-- PAGE.Field10 --] --]
</td></tr>
[-- END_IF --]
royhink
 
Posts: 104
Joined: Fri Jul 20, 2007 10:04 am
Location: Petaluma, CA

Postby JeremeD » Wed Aug 08, 2007 2:01 pm

Roy,

You've got the right idea. You're just trying to execute it the wrong way.

Your include file should look something like this:

Code: Select all
[ IF VAR.testimonial "code1" --]
  code1 stuff here
[-- ELSE_IF VAR.testimonial "code2" --]
  code2 stuff here
[-- ELSE_IF VAR.testimonial "code3" --]
  code3 stuff here
[-- END_IF --]


The code1, code2, and code3 are what you would enter in your Product.Field10.

Now, where you want to use this include you would have:

Code: Select all
[-- IF Product.Field10 --]
 [-- VAR.testimonial Product.Field10 --]
 [-- INCLUDE include_name_here PROCESS --]
[-- END_IF --]


All this does is set the value of the testimonial variable to the code in Product.Field10 then loop through the include file looking for a match.
SD360.com
Certified ShopSite Designer
ShopSite Templates Available Now
JeremeD
 
Posts: 60
Joined: Sat Feb 10, 2007 4:20 pm
Location: Athens, GA

Postby royhink » Wed Aug 08, 2007 3:38 pm

Thanks for the "A-HA!!" moment, Jereme. I guess I was just looking at it differently, and could not see the VAR solution.

I'm still interested to know if you can nest INCLUDE tags. No?

Roy
royhink
 
Posts: 104
Joined: Fri Jul 20, 2007 10:04 am
Location: Petaluma, CA

Postby Jim » Wed Aug 08, 2007 6:44 pm

An Include file can include other files that have Include tags.
In in file a you can say
[-- Include file_b process --]
and in file_b you can have
[-- include file_c process --]
Note that if the first one didn't have the "process" option then the second one would not be executed.

However in general you can't nest tags themselves like you had
[-- INCLUDE Test_[-- PAGE.Field10 --] --]
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 67 guests