Trouble using Global CALL tag in Page template

Questions and answers about ShopSite Custom Templates

Trouble using Global CALL tag in Page template

Postby twlontz » Tue Mar 20, 2012 4:30 pm

I have the following statement in one of my Page Templates

[-- CALL myWishList01.pl (twlontz@gmail.com) --]

When I try to Publish the page, I get the following error:

Generating Page [67:testpage3]...
myModernv4.sst [140]: Template Error: Call Program does not exist: myWishList01.pl

The program is located in the following directory:
http://yourrcstorecom.fatcow.com/cgi-bin/

I have also saved the program in the following directory:
http://yourrcstorecom.fatcow.com/shopsite/CGI/

and get the same error.

What do I need to change so the CALL tag will find my Perl script?

Thanks
twlontz
 
Posts: 12
Joined: Thu Oct 06, 2011 1:17 pm

Re: Trouble using Global CALL tag in Page template

Postby Jim » Tue Mar 20, 2012 5:00 pm

Since the CALL is being executed by the generate.cgi which is located in the /ss you need to put the perl script in that directory. Here is a section from the online help.
Code: Select all
CALL External Program

[-- CALL program.cgi{(parameter1, parameter2, parameterN)} --]
    Calls a user-supplied program and replaces the tag with any output from the program. Parameters can be passed to the program by including them as a comma-separated list within parentheses after the program name. If the program does not require any parameters, you do not need to include the parentheses.

    If a CALL tag is used in a page or product template, the user-supplied program must be in the ShopSite CGI directory. If a CALL tag is used in a shopping cart or registration template, the program must be located in the shopping cart directory.

    You can include any of the following, which will be substituted before the program is called:

        Database fields, in the same form as defined for pages and products, such as PAGE.Name or PRODUCT.Graphic
        STORE_ID - the store's StoreID
        OUTPUT_DIRECTORY_URL - the URL of the store's HTML directory
        OUTPUT_DIRECTORY_PATH - the path of the store's output directory
        SHOPPING_CART_URL - the URL of the store's shopping cart
        DATA_DIRECTORY_PATH - the path of the store's data directory
        PRODUCT.MoreInfoURL - the path of the product's More Information page

    Example:

    [-- CALL createthumbnail.pl(20,20,PRODUCT.Graphic) --]

    The above example would call a program called createthumbnail.pl in the ShopSite CGI directory, and pass in the values 20, 20, and a full <img> tag for the graphic of the current product. This program might return an <img> tag to a newly-created 20x20 thumbnail of the product graphic.
The url to the ShopSite CGI directory referenced can be found by going to Preferences > Hosting Services and looking at the Merchant CGIs URL: field. You will have to determine from that the location of the path on the server. Also make sure that the perl file is set to executable.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Trouble using Global CALL tag in Page template

Postby twlontz » Wed Mar 21, 2012 8:40 am

Thanks for the quick response. That enabled me to change my code and the page template now generates without error.

However, I still must be missing something because the [-- CALL statement or any replacement code does not appear when I view the browser page source.

Below is a portion of my page template code and what displays when viewing the browser page source

code from ShopSite Page Template

<div>
#############################
# Wishlist Search
#############################

<table width="650">
<tr>
<td width="100" colspan="2" align="center">Action</td>
<td width="550" align="center">Description</td>
</tr>


[-- CALL myWishList01.pl {myemail@gmail.com} --]

</table>

</div>

*******************************************
*******************************************
View of FireFox browser Page Source

<div>

<table width="650">
<tr>
<td width="100" colspan="2" align="center">Action</td>
<td width="550" align="center">Description</td>
</tr>



</table>

</div>

I know I must be missing something or doing something wrong.

Thanks for your help.
twlontz
 
Posts: 12
Joined: Thu Oct 06, 2011 1:17 pm

Re: Trouble using Global CALL tag in Page template

Postby Jim » Wed Mar 21, 2012 1:34 pm

For one thing the curly braces { } should be parens ( ). The curly braces { } are used in the help to indicate optional parmeters.

What is your perl script suppose to do? What happens when you run it on the command line on the server? does it give you the expected result? Is it set to be executable?

Here is a small perl script you can use for testing
Code: Select all
#!/usr/bin/perl

print $ARGV[0];
print "<br>";
print @ARGV[1];
print "\n";
When I use the template tag [-- call jim.pl (this, works) --] I get

this
works

displaying on the store page where I placed the tag.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 13 guests

cron