|
#1
|
|||
|
|||
|
Categories description
Good evening,
I want to add a description to a category. I created the table categories_description and created the input boxes in the admin section to add the description. That part works, I can add a description to a category. No I want to show this data from my template, but I'm not sure how I should do this. Who can point me in the right direction? Thanks. Marco |
|
#2
|
|||
|
|||
|
I did it a different, less efficient way: I made an add-on to read in a text file whose filename matches the number of the category as found in the GET data.
Code:
if ($_GET['category']) {
$file_to_read = '/descriptions/'.$_GET['category'].'.html';
$frag_to_add = file_get_contents($file_to_read);
}
else {
$frag_to_add = "";
}
$tpl = ereg_replace("<CATEGORY_DESCRIPTION>",$frag_to_add,$tpl);
__________________
http://asiftosay.com |
| Post Reply |
| Thread Tools | |
|
|