Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Category Description
DonH
post Dec 31 2010, 11:12 AM
Post #1


Fanatic
******

Group: Members
Posts: 962
Joined: 13-September 08
From: Minneapolis Minnesota USA
Member No.: 4,500
2.1.1 build 10874


Reputation:   35  


Maybe this will help others learning 2.0. cool.gif
I had made use of the Category Description in designs with previous versions. After porting over to 2.0, those descriptions were no longer being shown. Using Page Manager, I added a block to the center column for the product-list page with the following block content:
<div class="category_description">
<?php CategoryDescription(); ?>
</div>
Enclosing it in the div allows me to style it differently. After adding the block, I dragged it immediately below the Category Image block.

Edit...
I discovered that the above adds space for the div when there is no CategoryDescription to display, so I added a check to only display the block if the CategoryDescription is not empty:
<?php if (getCategoryDescription() != ''): ?><div class='category_description'><?php CategoryDescription(); ?></div><?php endif; ?>
Go to the top of the page
  
+Quote Post
samo
post Apr 1 2012, 09:45 AM
Post #2


Newbie
*

Group: Members
Posts: 7
Joined: 24-November 11
Member No.: 7,712
Version: 2.1.1 Version Type: Free Build: 11190


Reputation:   0  


QUOTE (DonH @ Dec 31 2010, 09:12 PM) *
Maybe this will help others learning 2.0. cool.gif
I had made use of the Category Description in designs with previous versions. After porting over to 2.0, those descriptions were no longer being shown. Using Page Manager, I added a block to the center column for the product-list page with the following block content:
<div class="category_description">
<?php CategoryDescription(); ?>
</div>
Enclosing it in the div allows me to style it differently. After adding the block, I dragged it immediately below the Category Image block.

Edit...
I discovered that the above adds space for the div when there is no CategoryDescription to display, so I added a check to only display the block if the CategoryDescription is not empty:
<?php if (getCategoryDescription() != ''): ?><div class='category_description'><?php CategoryDescription(); ?></div><?php endif; ?>



Thank you for such a great post DonH, it really helped. But please how can I make the description appear to the side of the image rather than the bottom. Thank you
Go to the top of the page
  
+Quote Post
DonH
post Apr 1 2012, 10:54 AM
Post #3


Fanatic
******

Group: Members
Posts: 962
Joined: 13-September 08
From: Minneapolis Minnesota USA
Member No.: 4,500
2.1.1 build 10874


Reputation:   35  


It is in its own div, so you can style and position that div using CSS. I doubt that it is editable using the built in CSS editor. You would need to add a selector and rules to one of the style sheets manually.
Go to the top of the page
  
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 12:14 AM