![]() |
![]() |
![]() |
|
|||||||
| User interface Discuss eSyndiCat templates here. All the questions regarding eSyndiCat [FREE] Front end |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Join Date: May 2006
Posts: 96
![]() |
What I'm trying to do is to include file for each category so it would look like this:
for cat_id = 2 {include file="add/{$category.id}.php"} (thus include add/2.php) cat_id = 3 {include file="add/{$category.id}.php"} (thus include add/3.php) and so on... right now I get : Warning: Smarty error: unable to read resource: "{Array.id" in /home/sites/domain.com/smarty/Smarty.class.php on line 1095 .php"} what am I doing wrong? |
|
|
|
|
|
#2 |
|
Super Moderator
Join Date: Oct 2005
Location: Phoenix,Arizona (Valley of the Sun)
Posts: 5,356
![]() ![]() ![]() ![]() |
If you want to add something to a certain cateory (so it only shows in that category) you would use something such as this:
Code:
{if $category.id == 23}
This will only show in this specific category.
{/if}
__________________
Please don't ask me about script questions or sales issues through "Private Messages". Thanks! |
|
|
|
|
|
#3 |
|
Join Date: May 2006
Posts: 96
![]() |
I can hardcod it for every category but what I would like to do is to have category.id pass in to naming convention of the file I'm trying to include.
so when I do include_file= it will be driven by category id... so it would automaticly name files 1.php or 2.php or 23.php based on category id. |
|
|
|
|
|
#4 |
|
Guest
Posts: n/a
|
What exactly these php files will contain? BTW here is an approximate solution:
Code:
{assign var="id" value=$category.id}
{include file=$id}
|
|
|
|
#5 | |
|
Join Date: May 2006
Posts: 96
![]() |
Quote:
What I wanted to do is “sponsored by” and include banner.. Basically each category can have its sponsor. |
|
|
|
|
|
|
#6 | |
|
Guest
Posts: n/a
|
Quote:
[1] Create text field "banners" in "dir_categories" table via phpMyAdmin. [2] ***open admin/edit-category.php*** ***find the following code*** Code:
$temp['description'] = addslashes($tmp['description']); Code:
$temp['banners'] = addslashes($tmp['banners']); Code:
<tr class="tr">
<td><strong>Category description:</strong></td>
<td><textarea name="description" cols="43" rows="8"><?php echo $category['description']; ?></textarea></td>
</tr>
Code:
<tr>
<td><strong>Category Banner:</strong></td>
<td><input type="text" name="banners" size="57" maxlength="150" value="<?php echo $category['banners']; ?>" /></td>
</tr>
[3] ***open templates/TemplateName/index.tpl*** ***find the following code*** Code:
{if $category.description}
<div class="box" style="border: none;">{$category.description}</div>
{/if}
Code:
{if $category.banners}
<div class="box" style="border: none;"><img src="{$category.banners}" /></div>
{/if}
Note: You can add this code in any other place you want. [4] Open your admin CP and browse to category where you would like to add banner. Click "edit" link button and after "Category description" fill in "Category Banner" field with full url of that banner. Save changes. That's all! |
|
|
|
|
#7 |
|
Join Date: May 2006
Posts: 96
![]() |
all I can say is wow.. thanks guys.
|
|
|
|
|
|
#8 |
|
Join Date: May 2006
Posts: 96
![]() |
oops, everything works fine Nick, but how do I make banner clickable so by clicking on it would send them to external site?
UPDATE: never mind.. did it the same way and created new field banners_url... took me 5 minutes. Last edited by 90210; 06-04-2006 at 05:32 PM. |
|
|
|
|
|
#9 |
|
Guest
Posts: n/a
|
You are welcome, 90210!
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can I include files in the template? | echopulse | User interface | 6 | 12-13-2005 07:20 AM |
| Just a curiosity based Question | John01 | General Chat | 1 | 01-01-1970 01:56 AM |
| smarty based blog to use with esyndicat | Vasily B. | Common Questions | 9 | 01-01-1970 01:04 AM |
| Category dont work | seniOr | Common Questions | 6 | 01-01-1970 01:02 AM |
| Does Locked Category include subcategories? | Peter Leenders | Common Questions | 3 | 01-01-1970 12:43 AM |