Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 Additional Info Box?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jackbox
VP-CART New User

United Kingdom
72 Posts

Posted - February 12 2005 :  05:10:00  Show Profile  Visit jackbox's Homepage  Reply with Quote
Not sure if this is the same with version 5, but in version 4.50 I'm using templates for product display and basically on the second page (tmp_product.html) I want it to show the line "Additional Info" for that field ONLY if there is additional info to display. I'm not a coder, but presume its a case of:

If [extendeddesc] = 0 then display nothing
If [extendeddesc] = something then display "Additional info:[extendeddesc]

Whats the code for that and where would I put it given I'm using temp_product.html as the template for that page.

devshb
Senior Member

United Kingdom
1904 Posts

Posted - February 13 2005 :  04:11:33  Show Profile  Visit devshb's Homepage  Reply with Quote
I don't think you can use vbscript inside the actual html templates. I think you can only use html and template-fields (and javascript).

But, something that will work that's part of the vpasp template-field processing is you can add a $ to the front of the line.

Adding a $ to the very front of the physical html line which has the field in it will automatically only show the rest of the html in that line if the value in the template field is not blank.

so, if you put:

$Additional info:[extendeddesc]


in your template html then that'll do what you want.

In this instance, the $ isn't shown in the final html; it's just an internal character that the template processing uses to see if this logic should be applied.

you can also put tags and stuff in there and the same logic will apply, eg:

$<br>Additional info:[extendeddesc]

or

$Additional info:[extendeddesc]<br>

or

$<tr><td>Additional info:</td><td>[extendeddesc]</td></tr>

Simon Barnaby
Developer
[email protected]
www.BigYellowZone.com
Web Design, Online Marketing and VPASP addons

Edited by - devshb on February 13 2005 04:14:12
Go to Top of Page

jackbox
VP-CART New User

United Kingdom
72 Posts

Posted - February 13 2005 :  09:49:24  Show Profile  Visit jackbox's Homepage  Reply with Quote
Bloomin 'eck I didn't know that Simon! Gosh you solved a huge problem there. Thank you so much for taking the time to answer this - it really IS appreciated. :)

Go to Top of Page

apswater
VP-CART Super User

444 Posts

Posted - February 14 2005 :  15:17:32  Show Profile  Visit apswater's Homepage  Reply with Quote
Good one Simon, I didnt know that one either.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00