Forums / Templates, Stylesheets, Page Layout / adding description to category listing

adding description to category listing

Locked

Views: 3,931

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
4 Jul 2006, 7:01 PM
#1
jonathan_pohl avatar

jonathan_pohl

New Zenner

Join Date:
Jun 2006
Posts:
17
Plugin Contributions:
0

adding description to category listing

I'm running into problems getting category descriptions to display in the category listing. For example I'm trying to make it so that the following page:

http://www.sphotos.biz/store/index.php?main_page=index&cPath=1_2_3

will display the category image, followed by the category name, followed by the category description.

I tried inserting $categories->fields['categories_description'] into category_row.php but its not displaying.

I'm totally new to php so I'm assuming that I'm not correctly calling the variable.

Thanks!

4 Jul 2006, 10:01 PM
#2
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: adding description to category listing

Can you please explain clearly what did you add in which file?
Also, did yo useperately try to echo the cateogry description and getting any value in the .php file?
San

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

4 Jul 2006, 10:24 PM
#3
jonathan_pohl avatar

jonathan_pohl

New Zenner

Join Date:
Jun 2006
Posts:
17
Plugin Contributions:
0

Re: adding description to category listing

jonathan_pohl:

I tried inserting $categories->fields['categories_description'] into category_row.php

Specifically I altered line 39 so that it is now as follows:

  'text' => $categories->fields['categories_description'] . '<br />' . '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');

I tried to echo $categories->fields['categories_description'], but am not getting any output.

Thanks again

9 Jul 2006, 2:03 PM
#4
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: adding description to category listing

jonathan_pohl:

Specifically I altered line 39 so that it is now as follows:

'text' => $categories->fields['categories_description'] . '<br />' . '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');

> 
> I tried to echo $categories->fields['categories_description'], but am not getting any output.
> 
> Thanks again
That explains it
Go above the code where it is getting the value and try to figure out the reason!

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

13 Jul 2006, 9:37 PM
#5
fattchris avatar

fattchris

New Zenner

Join Date:
Jul 2006
Posts:
10
Plugin Contributions:
0

Re: adding description to category listing

Has anyone figured this out yet? I am trying the same thing and can get a static word to sho up every time after the category name, but cannot figure out how to get the category description to populate.
thanks
Chris

16 Jul 2006, 2:43 PM
#6
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: adding description to category listing

fattchris:

Has anyone figured this out yet? I am trying the same thing and can get a static word to sho up every time after the category name, but cannot figure out how to get the category description to populate.
thanks
Chris

Can we see the cart so that we can help?

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

16 Jul 2006, 4:51 PM
#7
fattchris avatar

fattchris

New Zenner

Join Date:
Jul 2006
Posts:
10
Plugin Contributions:
0

Re: adding description to category listing

sure.

http://www.livinghopechurch.com/cart/

here is what I want it to look like....

thanks for any help you can provide!

Chris

18 Jul 2006, 6:58 PM
#8
jonathan_pohl avatar

jonathan_pohl

New Zenner

Join Date:
Jun 2006
Posts:
17
Plugin Contributions:
0

Re: adding description to category listing

sorry...i've been away from this project for a while, anyways i'm not quite sure why "that explains it". I can get static output, and I check and made sure that the variable that i'm calling is defined just like the others being called in that argument. can you give me something a little more specific than "go above the code and figure out whats going on".

thanks

30 Jan 2007, 5:56 AM
#9
andrabr avatar

andrabr

New Zenner

Join Date:
Jan 2007
Posts:
36
Plugin Contributions:
0

Re: adding description to category listing

jonathan_pohl:

sorry...i've been away from this project for a while, anyways i'm not quite sure why "that explains it". I can get static output, and I check and made sure that the variable that i'm calling is defined just like the others being called in that argument. can you give me something a little more specific than "go above the code and figure out whats going on".

thanks

$categories is an array, but there is no "categories_description" element in it. I do not know where it is created, but would love to so that I can achieve same result you desire.

A>

30 Jan 2007, 6:02 AM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: adding description to category listing

What version of Zen Cart are you using?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Jan 2007, 6:31 AM
#11
andrabr avatar

andrabr

New Zenner

Join Date:
Jan 2007
Posts:
36
Plugin Contributions:
0

Re: adding description to category listing

Ajeh:

What version of Zen Cart are you using?

I am using Zen Cart 1.3.7

Just found the solution to the big question above:

To get category description directly use something like this:
zen_get_category_description($categories->fields['categories_id'],'1')

The first parameter is the category id (Surprise!)
The second parameter is your desired language ID.

So, line 39 of my new category_row.php now looks like this:

$list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
                                       'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<div class="category-name">' . $categories->fields['categories_name'] . '</div class="category-name"></a>'.'<div class="category-description">' .zen_get_category_description($categories->fields['categories_id'],'1') . '</div class="category-description">');

And I get category descriptions in the list of categories - exactly what I (and others) wanted.

A more efficient way would be to improve category_tree.php, but the override system does not cover classes :( [not that I am bold enough to try a stunt like that]

11 Feb 2008, 11:48 PM
#12
piscesfish avatar

piscesfish

New Zenner

Join Date:
Jan 2008
Posts:
23
Plugin Contributions:
0

Re: adding description to category listing

Hi,
I made the change as mentioned above and it works, however I would like to position these div's to the right of the picture to conserve space.
I tried to no avail. Any ideas?

.category-description{
float:right;
clear:right;
width:50%;
text-align:left;
}
.category-name{
float:right;
clear:right;
width:50%;
text-align:left;
}

http://www.sitemagicdesigns.com/zen/stoneawards-c-33.html?zenid=ecf47027d530b57f6038d81363fe427b