Gossamer Forum
Home : Products : Gossamer Links : Discussions :

dynamic category pages

Quote Reply
dynamic category pages
I have a static directory that uses the simple style, but I'd like to be able to call individual categories dynamically which load with a custom category.html file for each directory. Each custom category.html will call their own custom header and footer as well.

I've tried creating copies of the category.html, renaming them, and saving them to the simple template set (the one I'm using)

I call the page dynamically using:

http://www.mysite.com/...tom_cat.html&d=1

And it loads the correct page, but with the following errors:

Unknown Tag: 'title_linked'
Unknown Tag: 'category_clean'
No category_id tag found! This tag can only be used on category.html template

The reason I'm not using templates for this is that the header and footer for each of the custom categories will be different.

It seems like I've almost got it..., but can anybody tell me why I'm getting those errors?

Thanks :)
Quote Reply
Re: [codetrance] dynamic category pages In reply to
You can't do it this way because there are special variables passed into the category templates which you wont get by using p=. The way to do it is to put the custom_cat.html into your category table in the category template field.
Quote Reply
Re: [afinlr] dynamic category pages In reply to
Ok. I see how I can have a given category load with a particular template by adding the custom template to the category template field, but I'm guessing this custom template will load every time you call that particular category.

What I'm looking for is the ability to call a custom template dynamically and only have it show up IF it's been called dynamically.

I had hoped to cobrand the directory, for which I'd use the global template system (I see how the script supports this), but on my own version of the directory, I had wanted to be able to dynamically call a category and have it load my custom category and it's related headers and footers... (but not have the custom category show up in cobranded versions)

I'm guessing maybe this can't be done? I certainly appreciate the help however.

Anybody have any ideas?

Thanks,

Roger

Last edited by:

codetrance: Oct 16, 2003, 8:58 AM
Quote Reply
Re: [codetrance] dynamic category pages In reply to
I'm not quite sure that I follow what you want to do yet.

Is it that you have some categories which you only want to be viewable on your site? And they have to use a different template from all the other categories? Is there any reason why you need to load them dynamically? Can you just have another go at explaining please?
Quote Reply
Re: [afinlr] dynamic category pages In reply to
Sure I'll try again :)

If I were to go in and edit the category template field in the database for each category that I want to change, as you suggest, then I imagine those changes would reflect not only in my site, (the only place I want them) but also in the cobranded sites...

I'm thinking that when the script calls a category from the databse, looks in the category template field and sees my custom category template, it is going to display that custom category template whether it's on my site (using my template style) or on a cobranded site (with another template style)

I was looking for, was a method of having the custom category templates display only on my directory, and not for any of the cobranded directories...

What do you think?

Thanks :)

Roger
Quote Reply
Re: [codetrance] dynamic category pages In reply to
OK - that sounds easier.

In your default template set (or the one you are using on your site) you would create the new template custom_cat.html and change it. But, in your cobranded template set, you still create the custom_cat.html file but just copy category.html so it isn't different.
Quote Reply
Re: [afinlr] dynamic category pages In reply to
Yeah I see what you are thinking, create a custom category template and put it in each template set for each site.

However, when you go into the database, and associate a given category with a particular category template, does this not reflect on all sites? (as each category in the database can only be associated with one custom category template...

I need to be able to associate several categories with a custom category template for each one, but only have this show on my site, not on the cobranded sites, as I'm thinking they would with this method....?

Last edited by:

codetrance: Oct 16, 2003, 4:39 PM
Quote Reply
Re: [codetrance] dynamic category pages In reply to
Yes but - you don't need to make the custom category templates different from the original category templates in your other template sets. In face you could just put <%include category.html%> as the only tag in the custom templates and they would be exactly the same as your original categories - and would be updated correctly when you update category.html.
Quote Reply
Re: [afinlr] dynamic category pages In reply to
I think I finally see what you are saying:

Even though a category in the database can only be associated with one category template, as long as that template exists within each template set, and has the same filename (eg. customcat.html), that category template can have completely different contents.

In other words, for those who are slow to get it like me :)

The script looks in the database at the given category, calls an assigned category template if there is one, (or defaults to categories.html), and depending on what template set has been called, loads the assigned category template, which, while it has the same filename, can be a completely different file in each template set...

Man, I'm sitting there looking at all these convoluted options when what I needed was right there! *smacks head*

Ah well, maybe it was the fumes from staining my deck this afternoon....

Thanks :^)

Roger

Last edited by:

codetrance: Oct 16, 2003, 6:08 PM
Quote Reply
Re: [codetrance] dynamic category pages In reply to
Sorry - my fault for not making it clear enough to start with Wink. (I was beginning to wonder whether I had misunderstood what you were trying to do!)
Quote Reply
Re: [afinlr] dynamic category pages In reply to
I was playing with setting it up in the fashion we described, and I remembered why I was trying to do it dynamically...

Forget about the cobranded versions for the moment...

You see on my site, I want to have an instance of the directory where the surrounding interface is the same for all categories.

But I will also be having 'regionally' focused pages on my site, where I thought to include category listings from the directory for that particular region. (basically using the directory to provide some additional content on these pages) These regional pages would have a completely different interface from the main directory.

If I assign 'regional' templates in the database for a particular regional category, Then that template would show up both in the main directory, and also in the 'regional' pages of the site. Which would be wierd, because someone might be surfing the directory, click into a regional category, and then all the sudden they are on a very different page. This is why I was looking to do it 'dynamically'

My thought was to call the category listings for the particular region via the XML plugin, but I've been through all these boards and the one script Gossamer provided as an XML parser does not work...

You have any ideas?

Thanks once more :)

Roger
Quote Reply
Re: [codetrance] dynamic category pages In reply to
What about just using another template set for the regional pages? This would keep them completely separate from the main directory.
Quote Reply
Re: [afinlr] dynamic category pages In reply to
Good point,

But then if someone was on a regional page, and started browsing other categories of the directory, then they would remain within the regional template set, which is not necessarily a big deal.

I know this is wierd, but if someone is in the main directory, I'd like them to stay in the main template set, and then if someone is on a regional page, (using the regional template set) and clicks into another category, in this case I'd want them to go back to the main template set. (main directory)

Hence the idea of using XML, because wouldn't that just load a list of categories and links for a particular region, and if someone clicked on another category besides regional, or clicked on the top breadcrumb trail, it would take them to the main directory right?

Thanks,

Roger
Quote Reply
Re: [codetrance] dynamic category pages In reply to
Well, the way I would do this is to have a new template set BUT not load it dynamically. So you would link to the page in question with http://www.mydomain.com/...egory&t=regional

If you miss off the d=1, all the other links on the page should take you to your default template set. (So in effect this is the dynamic template loading that you were looking for in the first place!)
Quote Reply
Re: [afinlr] dynamic category pages In reply to
Hehe That does work, and solves my problem, Thank You. :)

One last question. I like having my main directory as static pages, which is more search spider friendly, and I'm guessing there's no way to do the regional pages other than how we've specified by calling them with:

http://www.mydomain.com/...egory&t=regional

Naturally the main engine I'm concerned with is Google. Since you appear to be the masterful LinksSQL user, do you have any experience with google's ability to index LinksSQL dynamically generated pages? stuff with a query string?

Thanks again for the help, It's really nice that you took the time to offer all these reponses.
Quote Reply
Re: [codetrance] dynamic category pages In reply to
I'm not really sure how much Google likes dynamic pages. I have a lot of dynamic pages listed in Google so it definitely doesn't ignore them, but I'm not sure whether it indexes them or not. Several people have said recently that they don't think there is a problem but I know that Alex said that their hits from Google increased dramatically when GT introduced search engine friendly urls for the forum pages.

http://www.gossamer-threads.com/...i?post=203467#203467

If you have a dedicated server you can use rewrite rules to make these pages look static which is what I do.
Quote Reply
Re: [afinlr] dynamic category pages In reply to
Oh yeah, that's a good idea.

Well it looks like all my problems on that front are solved...

Now if I could just figure out why all my links and categories just disappeared from the admin.... :P

Thanks again :)

Roger