Gossamer Forum
Home : Products : Links 2.0 : Customization :

Dynamic category pages

Quote Reply
Dynamic category pages
I've noticed a few people have requested a mod which creates dynamic category pages.

Such a mod could be made quite easily by altering and using parts of my comments 3 mod.

I'll come up with a solution next week when I get bored and need a break from my coursework (normally all the time!).

Good Luck!

Glenn


http://findarom.emusanet.com/comments3/
Quote Reply
Re: Dynamic category pages In reply to
That's great! However, I'm on a different quest and it sounds like you know what you're doing. Maybe you can help.

I would like to like to add a feature to put the 'build' date at the bottom of our 'Pages' HTML's. In other words, when we do a 'build', we want the date to be reflected at the bottom of the various HTML pages generated in/by CATEGORY.HTML. We would want it to say, for instance, "Page Updated: Sunday, February 11, 2001" or such.

Got any ideas on achieving this. We've scoured Gossamer Web Site but can't find this simple mod.

The obvious 'fix' is to edit the CATEGORY.HTML file every time we do a 'build', but there's got to be a way to do it via scripting, don't you think?

-------------------------
Lenon.com's Links 2.01
http://www.lenon.com
Quote Reply
Re: Dynamic category pages In reply to
It's already defined as a global variable.


Just go into category.html and add:

Page upated on:<%date%> - <%time%>



Good Luck!

Glenn


http://findarom.emusanet.com/comments3/
Quote Reply
Re: Dynamic category pages In reply to
Thanks again Glenn Laugh

Quote Reply
Re: Dynamic category pages In reply to
In Reply To:
Just go into category.html and add:

Page upated (sic) on:<%date%> - <%time%>
Already tried that and it didn't work. Besides, having pondered this 'fix' for awhile, don't you think this would merely give the current (system) date and time, and not the actual 'Build' date and time?

Remember, CATEGORY.HTML builds dynamically using the global variables. What I'm looking for is something that will (either) build the HTML files using the 'Build' date, or at least find a variable that is fixed to the date of last 'Build.' Does this variable exist?

Comments in SITE_HTML.PL state:
In Reply To:
$time : The current time.
$date : The current date.

and...

$date = &get_date;
$time = &get_time;
Is this incorrect?

-------------------------
Lenon.com's Links 2.01
http://www.lenon.com
Quote Reply
Re: Dynamic category pages In reply to
Already tried that and it didn't work.

It should work, because it's defined globally and so can be used on any of the templates.

Besides, having pondered this 'fix' for awhile, don't you think this would merely give the current (system) date and time, and not the actual 'Build' date and time?

It writes the current time when you build the directory. This date and time is not updated untill you rebuild the directory.


'Remember, CATEGORY.HTML builds dynamically using the global variables. What I'm looking for is something that will build the HTML files, or at least a variable that is fixed to the date of last build. Does this variable exist?'


It is fixed to the date of the last build. Once it's written onto category.html (a static html page) it is only altered when you rebuild the directory.

Good Luck!

Glenn


http://findarom.emusanet.com/comments3/
Quote Reply
Re: Dynamic category pages In reply to
It takes the "current" time when the site was built, so thus, the $date and $time variables print the date and time when the directory was built. Think about it...the pages are NOT dynamic (by default)...what glennu will have to do to preserve the actual build date is use other variables to define the build date, because in the "dynamic" mode that glennu is re-creating (since it was already written by Widgetz awhile ago), if you use $date and $time in the site_html.pl OR <%date%> and <%time%> tags in the TEMPLATE files, then it will show the actual current date/time NOT the build date and time.

Hope this makes sense.

Regards,

Eliot Lee
Quote Reply
Re: Dynamic category pages In reply to
In Reply To:
It is fixed to the date of the last build. Once it's written onto category.html (a static html page) it is only altered when you rebuild the directory.
Okay, I'll try it again. Not to parse your reply (replies) or be overly critical, I think we are mincing words to some degree.

When I said that CATEGORY.HTML "builds dynamically" I meant 'displays dynamically.' Obviously CATEGORY.HTML is a static file, however, it contains global variables which are generated dynamically and, hence, has the effect of being dynamic in nature. To be truthful, I don't know how adding global variables giving the "current time and date" are going to display the desired data, but...

I'll let you know what happens. Thanks!

-------------------------
Lenon.com's Links 2.01
http://www.lenon.com
Quote Reply
Re: Dynamic category pages In reply to
In Reply To:
Think about it...the pages are NOT dynamic (by default)...
I ran across a curious problem recently. I noticed that my banners were not rotating on the 'result' pages generated by CATEGORY.HTML.

It turned out they were all using the same ID variable for the CATEGORY.HTML page, which I arbitrarily named "CATEGORY_PAGE."

I fixed this by, instead, using a (Links) global variable for pages (dynamically) generated (or displayed) by CATEGORY.HTML. That is, I changed the page ID for the banner program from "CATEGORY_PAGE" to "<%category_name%>". In that way, every page (dynamically) generated by CATEGORY.HTML would contain the category name (or true path of the category) as the ID, instead of the information generated by the static portion of the CATEGORY.HTML page.

In this sense, CATEGORY.HTML is indeed dynamic.

Hope THIS makes sense. :)

-------------------------
Lenon.com's Links 2.01
http://www.lenon.com
Quote Reply
Re: Dynamic category pages In reply to
Uh...NOT with the date and time values! Tongue

Regards,

Eliot Lee
Quote Reply
Re: Dynamic category pages In reply to
In Reply To:
Uh...NOT with the date and time values!
Heh! True... Wink

-------------------------
Lenon.com's Links 2.01
http://www.lenon.com
Quote Reply
Re: Dynamic category pages In reply to
Right now I understand you.

How about writing the date to a text file which gets overwritten with the new date each time you build the directory.

Then you could just retreive that value from the text file each time you open category.html

Good Luck!

Glenn


http://findarom.emusanet.com/comments3/
Quote Reply
Re: Dynamic category pages In reply to
In Reply To:
How about writing the date to a text file which gets overwritten with the new date each time you build the directory...
Yep, that sounds like a good idea --- use Server Side Includes, you mean? That would work, except I would have to change a bunch of tags to the .SHTML extension.

Hmmm... not bad, but it seems like there should be an easier way. Everytime I start playing with SSI, I get discouraged and quit.

The obvious answer to all of this is to do away with the templates and just let SITE_HTML.PL build the dern pages. Gawd, the answer to this problem is sitting on the tip of my brain. Think! Think!

------------------------
Lenon.com's Links 2.01
http://www.lenon.com
Quote Reply
Re: Dynamic category pages In reply to
Yep, that sounds like a good idea --- use Server Side Includes, you mean? That would work, except I would have to change a bunch of tags to the .SHTML extension.


I wasn't thinking of server side includes but you could use them.


The obvious answer to all of this is to do away with the templates and just let SITE_HTML.PL build the dern pages. Gawd, the answer to this problem is sitting on the tip of my brain.


Well if your category pages are dynamic as you mentioned, then you don't need to use ssi. Just add a few lines of code in site_html_templates.pl in the category_page sub which gets the info from the text file.
Then just add the tag in category.html.

Getting nph-build.cgi to write the date to a text file would be quite staright foward and only require a few lines of code.

Good Luck!

Glenn


http://findarom.emusanet.com/comments3/
Quote Reply
WOO HOO !!! : Dynamic category pages In reply to
Unbelievable!!! Thought I would update you, no pun intended.

I decided to do a little work on our Links program tonight and I decided to use the built-in template editor. I normally use HomeSite 'cuz it has an excellent find-n-replace feature in it --- allows us to make changes to all the various templates with one click.

I decided to try the ol' <%date%> <%time%> variables one more time. When I did a 'build', there it was, date and time. So, I tried to figure out what I had been doing wrong all these years.

After doing a little thinking about, I believe I was editing the HTML's and uploading them to the site, but I wasn't running a 'build' before checking them out. I think I must have been simply uploading the templates and looking at them without doing a 'build.' Well, DUH!!!

I'll bet this is the situation in every case. I've heard ppl say that it doesn't work, including myself, and I'll bet they've all been doing the same thing as me.

Anyway, works great! I can't believe it. Thanks to all for the help. Hope this message helps others too...

------------------------
Lenon.com's Links 2.01
http://www.lenon.com