Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Calling and Displaying Category Description within a List.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-21-2005, 10:36 AM
 
Jennifer Martin Jennifer Martin is offline
 

Newbie
  
Join Date: Nov 2005
Posts: 4
 

Default Calling and Displaying Category Description within a List.

Here is the page I am currently working on:

http://10000waves.xynergy.com/FloatingWorld/home.php

You'll see 4 categories tiled underneath the large advertisement image. Each of the categories currently display the Category Name and the Category Icon. I am trying modify the page so that the Category Description is also displayed underneath the Category Name.

Here is the code I have so far within a custom tpl file I've created for this page:

Code:
{* $Id: category-index.tpl,v 1. 2005/11/20 15:15:49 mclap Exp $ *} <table width="100%" border="0" cellpadding="5" cellspacing="0" class="border-white" style="background-color:#4D79A0;"> <tr> <td><div align="left"> <a href="home.php?cat={$categories[2].categoryid}"> [img]GRAPHICS/store-main.gif[/img] </a> </div> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top">[img]{$xcart_web_dir}/icon.php?categoryid={$categories[0].categoryid}[/img] </td> <td valign="top"><div style="margin-left:5px; margin-right:5px;"> {$categories[0].category} {$categories[0].description|escape:"html"} </div></td> <td valign="top">[img]{$xcart_web_dir}/icon.php?categoryid={$categories[1].categoryid}[/img] </td> <td valign="top"><div style="margin-left:5px; margin-right:5px;"> {$categories[1].category} {$current_category.description|regex_replace:"/[\n]/":" "} </div></td> </tr> <tr> <td>[img]{$xcart_web_dir}/icon.php?categoryid={$categories[2].categoryid}[/img] </td> <td valign="top"><div style="margin-left:5px; margin-right:5px;"> {$categories[2].category} {$current_category.description|regex_replace:"/[\n]/":" "} </div></td> <td>[img]{$xcart_web_dir}/icon.php?categoryid={$categories[3].categoryid}[/img] </td> <td valign="top"><div style="margin-left:5px; margin-right:5px;"> {$categories[3].category} {$current_category.description|regex_replace:"/[\n]/":" "} </div></td> </tr> </table></td> </tr> </table>

I have tried calling the category using the standard:

Code:
$current_category.description|regex_replace:"/[\n]/":" "}

As well as:

Code:
{$categories[2].description}

both to no avail.

Is there other syntax I can use to call this variable?
__________________
Xcart version 4.0.16
Reply With Quote
  #2  
Old 11-22-2005, 06:03 AM
 
Jennifer Martin Jennifer Martin is offline
 

Newbie
  
Join Date: Nov 2005
Posts: 4
 

Default Nevermind

I figured it out.

I used this:

Code:
{php}func_print_r($this->_tpl_vars);{/php}


to view what variables I had available on the page I'm working on.

I saw that the variable [description] was not listed.

So I went to include/categories.php and added

Code:
$sql_tbl[categories].description

to the line:


Code:
if ($short_list) { $to_search = "$sql_tbl[categories].categoryid,$sql_tbl[categories].parentid,$sql_tbl[categories].categoryid_path,$sql_tbl[categories].category,$sql_tbl[categories].product_count,$sql_tbl[categories].description,$sql_tbl[categories].avail,$sql_tbl[categories].order_by";

and the rest is history!

Thanks for all your "help" forum people.
__________________
Xcart version 4.0.16
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:30 AM.

   

 
X-Cart forums © 2001-2020