[ic] Ed's Solution for Using the Script Name Variable

Ed LaFrance interchange-users@interchange.redhat.com
Mon Oct 1 11:55:01 2001


At 10:33 PM 09/29/2001 -0400, you wrote:

>Ed and others ... thanks for your suggestions.
>
>Ed, I found what I think you are referring to at:
>
>http://developer2.akopia.com/archive/interchange-users/2001/msg05007.html
>
>It appears to me that all I have to do is include the code in this message 
>within one of the .cfg files.

Yep.  You could paste it into VENDROOT/interchange.cfg, or save it into a 
file named env.tag in VENDROOT/usertag/ (IC restart to activate in either 
case).  I think it will also work at the catalog level, which means you 
could paste it into CATROOT/catalog.cfg, or create a usertag directory in 
your CATROOT, save it as a file there, and put this line in your catalog.cfg:

include usertag/*  #NOTE: this may need a leading '#', I am not sure, due 
to new directives.

..and reconfig your catalog in either case.


> From there, how would I call up a specific variable?
>
>Would I do something like this?
>
>[env SCRIPT_NAME] somewhere in an Interchanged parsed page?

Yes, that is right, provided that variable is defined on your 
server.  There is some documentation at the top of the tag.  You can get a 
table of all variables by putting [env] (no argument) on a page in your 
catalog.

>When I do can I expect the SCRIPT_NAME to be echoed where ever the tag is 
>located?

You can also capture it:

[seti script_name][env SCRIPT_NAME][/seti]

- Ed L.




>CV
>
>
>At 11:11 AM 9/29/2001 -0400, cfm@maine.com wrote:
>>On Sat, Sep 29, 2001 at 10:51:33AM -0400, Christopher Van Oosterhout wrote:
>> >
>> > Greetings All,
>> >
>> > When I use the dump tag, [dump], to get an idea of just what 
>> Interchange is
>> > collecting, I see a variable under ENVIRONMENT that may be useful to me.
>> >
>> > In particular I would like to the SCRIPT_NAME variable.  I have tried to
>> > use the [data session SCRIPT_NAME] tag without success.  It appear to me
>> > that the tag only works for "true" SESSION variables.
>> >
>> > I have two questions.  First, is it possible to drawn out and use the
>> > SCRIPT_NAME and other ENVIRONMENTAL variables?
>> >
>> > If not, could you suggest a way to do the following:
>> >
>> > I have set up multiple script aliases to the same store.  And it works
>> > expect I can not figure out how to reference links to the descriptions
>> > (flypages) of specific items in my site's search result page.  Currently I
>> > am using something like:
>> >
>> > /cgi-bin/storename/[part number]
>> >
>> > I would like to replace the "/cgi-bin/storename/" section of the URL with
>> > SCRIPT_NAME.
>> >
>> > Any ideas?
>>
>>Search on SCRIPT_NAME at google and look at what is provided
>>in a typical CGI environment.  Many servers provide more than the
>>standard requirements.
>>
>>
>>
>>cfm
>>
>>
>> >
>> > Christopher Van Oosterhout
>> >
>> >
>> > _______________________________________________
>> > interchange-users mailing list
>> > interchange-users@interchange.redhat.com
>> > http://interchange.redhat.com/mailman/listinfo/interchange-users
>>
>>--
>>
>>Christopher F. Miller, Publisher                               cfm@maine.com
>>MaineStreet Communications, Inc           208 Portland Road, Gray, ME  04039
>>1.207.657.5078                                         http://www.maine.com/
>>Content/site management, online commerce, internet integration, Debian linux
>>_______________________________________________
>>interchange-users mailing list
>>interchange-users@interchange.redhat.com
>>http://interchange.redhat.com/mailman/listinfo/interchange-users
>
>_______________________________________________
>interchange-users mailing list
>interchange-users@interchange.redhat.com
>http://interchange.redhat.com/mailman/listinfo/interchange-users

===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================