X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Calling and Displaying Category Description within a List. (https://forum.x-cart.com/showthread.php?t=18121)

Jennifer Martin 11-21-2005 10:36 AM

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?

Jennifer Martin 11-22-2005 06:03 AM

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.


All times are GMT -8. The time now is 11:59 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.