Gossamer Forum
Quote Reply
globals?
I have added in my MySQL Table "Category" a new field called "Description2" and now i would like to at a global (not sure if I can add this to the global?) so i can call the field in the templates files.

So I would like to add to the category.html (the template file) the following code:

<%if Description2%>
<%Description2%>
<%endif%>

and it should show the information of the "Description2" field from the MySQL table "Category".

It would be very nice if somebody could explain me what i need to do.

Thanks in advance.
Twistmaster

Sorry for my english. I hope everybody understands what i mean.


Quote Reply
Re: globals? In reply to
I have also added extra fields in my category/links table
In Links-SQL 2.0, you are able to add the tag directly into the subcategory template

Quote Reply
Re: globals? In reply to
What do I need to change in the Category.def file?

The first thing i need to do is to ad to the "'cols' =>" the code for the new field:

'Description2' => {
'pos' => '10', #because it is after the field footer
'type' => 'TEXT',
'form_type' => 'TEXTAREA',
'form_size' => '30',
},

The next thing i need to do is change all the "'pos'" to the new position of the fields.

Then what do i need to do?



Quote Reply
Re: globals? In reply to
And how did you do that?

Could you please post an example.

That would be really nice!


Quote Reply
Re: globals? In reply to
No, you don't want to edit the def files manually. Go to Database->Category->Properties and click on Add New Column. You can enter your information in there.

Cheers,

Alex

--
Gossamer Threads Inc.