Gossamer Forum
Home : Products : Gossamer Links : Discussions :

New templates and new database fields

Quote Reply
New templates and new database fields
Greetings!

I'm still working on our site and learning something new every day. I have some questions I hope you guys can answer, to put me on the right track. I've realized now that we need to have some extra fields in the database, since we need some extra information for certain categories in our product database. As an example, we have a "Literature" category where we want to have some extra detail field like "Author". Now, adding this field in the database is something I know how to do, but there are other things I need to understand.

1. I have tried creating a new template. Let's call it cat_literature.html . First of all, once I have created it in user templates, how do I get it to build as a static page?

2. I know that I can Browse to a category and define a specific template to it, which I reckon is what I must do. Ie. make a copy of the standard details.html template and add whatever fields extra from the database that I want displayed, like "Author". My second question, though, is "How do I deal with the forms for adding this info when someone is adding products?" Can I easily make it so that whenever someone is adding a product in the "Literature" category the "Author" field is added, but only then?

I'm sure I'll have several more questions even if these gets answered though. Thanks! :)
Cheers,
Hans Jørgen
www.dicereviews.com
Quote Reply
Re: [perhaps] New templates and new database fields In reply to
 1. I have tried creating a new template. Let's call it cat_literature.html . First of all, once I have created it in user templates, how do I get it to build as a static page?

Just hit build all.........


Can I easily make it so that whenever someone is adding a product in the "Literature" category the "Author" field is added, but only then?

<%if Category eq 'Literature'%>
Author
<%endif%>

Last edited by:

rascal: Jan 24, 2007, 6:04 AM
Quote Reply
Re: [rascal] New templates and new database fields In reply to
In Reply To:
1. I have tried creating a new template. Let's call it cat_literature.html . First of all, once I have created it in user templates, how do I get it to build as a static page?

Just hit build all.........


Hmm. That's what I was thinking, but I created a new template called about.html, and ran a build. I found the file in cgi/admin/templates/luna/local/about.html but is that the file I'm supposed to link to from the menu? I'm probably just very confused about all of this. Crazy
Cheers,
Hans Jørgen
www.dicereviews.com
Quote Reply
Re: [perhaps] New templates and new database fields In reply to
try this in your browser and see if page shows:

http://www.yoursite.com/...page.cgi?p=about;d=1
Quote Reply
Re: [rascal] New templates and new database fields In reply to
In Reply To:
try this in your browser and see if page shows:

http://www.yoursite.com/...page.cgi?p=about;d=1

No luck using that one, I'm afraid.
Cheers,
Hans Jørgen
www.dicereviews.com
Quote Reply
Re: [perhaps] New templates and new database fields In reply to
Ok. I tried something else now.

I created a cat_literature.html template and basically copied the contents of detailed.html and added an extra field that I added to the database for "Author". I then set the category Literature to use the new template in Browswer from the admin. I ran a full build, but now when I go to that category, I just get "Unknown Tag: 'Title'" etc. same for other database fields. Any ideas what I'm doing wrong? :)
Cheers,
Hans Jørgen
www.dicereviews.com
Quote Reply
Re: [perhaps] New templates and new database fields In reply to
I got some good tips from SandraR today that I'll try out. I reckon I've gone about things a bit wrong in regards to templates and how to make minor changes to different categories and we'll see how the suggestions work out. Smile
Cheers,
Hans Jørgen
www.dicereviews.com