Gossamer Forum
Home : General : Perl Programming :

Pulling data from local files

Quote Reply
Pulling data from local files
Being a newbie, had to ask this question...
I want to have a series of templates:

template1.html
template2.html
template3.html

and a series of data files with the basice html formating for text/tables, ect.

data1.html
data2.html
data3.html

Am trying to figure out how to merge the files with a comment tag in the template.html's such as <%--data1.html--%>

Is there a way or a script that will do this???

Thanks in advance...

Trust in your elders, for they hold the key to life...
Quote Reply
Re: Pulling data from local files In reply to
Use SSI....

Code:

< !--#include file="/path/to/data/<%ID%>.html"-- >


Without the space before and after the arrows.

Regards,

Eliot Lee

Quote Reply
Re: Pulling data from local files In reply to
Saw this the other day at ZDNet and thought it was cool:
http://www.zdnet.com/...4413,2184927,00.html

It's codes for using external templates with your Perl scripts, similar to what Links does.

--Drew
Quote Reply
Re: Pulling data from local files In reply to
I was trying to do it without ssi, but the second article is EXACTLY what I wanted to do... Just didn't know where to find the info, Thanks, Thanks, Thanks!!!!


Trust in your elders, for they hold the key to life...
Quote Reply
Re: Pulling data from local files In reply to
Actually, the ssi looks great too, didn't think about adding <%ID%> to the ssi call...

Trust in your elders, for they hold the key to life...
Quote Reply
Re: Pulling data from local files In reply to
Also have another question, ref the above URL...

http://www.zdnet.com/devhead/stories/articles/0,4413,2184976,00.html

I know the url above points to http://www.zdnet.com/devhead/stories/articles/ Directory and then pick up the 0,4413,2184976,00.html .html file. How does it do this, is it a script asp, or what???

Trust in your elders, for they hold the key to life...
Quote Reply
Re: Pulling data from local files In reply to
It's Vignette Story Server. It builds those CURLs (Custom URLs) internally for its caching and data passing mechanisms among other things.

It breaks down like this:
0 - Caching is turned on
4413 - The ID of the template being called
2184976 - the data being passed into it (probably a database ID)
00 - Used for browser/navigator types, 00 is the default

-- Gordon


s/(\d{2})/chr($1)/ge + print if $_ = '8284703280698276687967';
Quote Reply
Re: Pulling data from local files In reply to
What I am thinking of trying is to re-create this using links and dbman... Is this possible??? or would it take a complete rewrite of the scripts. Also, if not, is there a cgi script that can do the same thing, at a reasonable price, say under a $1000???

Trust in your elders, for they hold the key to life...
Quote Reply
Re: Pulling data from local files In reply to
It depends on how you are wanting to create it and from what and with what functionality.
Vignette Story Server costs around 300 thousand dollars initially with an enormous licensing cost.

-- Gordon


s/(\d{2})/chr($1)/ge + print if $_ = '8284703280698276687967';
Quote Reply
Re: Pulling data from local files In reply to
And trust Gordon and I on this, you DO NOT WANT ANYTHING TO DO WITH VIGNETTE. We are currently stuck using it, and it BLOWS.

If you want a free alternative, you can have a look at Mason. Mason appears to be stable enough, but is not yet at a 1.0 release version.

http://www.masonhq.com/

--mark

Installation support is provided via ICQ at UIN# 53788453. I will only respond on that number.