[SOLVED]CGBlog {$category.description} doesn't print

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm
Location: Florida

[SOLVED]CGBlog {$category.description} doesn't print

Post by carasmo »

I can't find how to get the description of the category, the file admin_editcategory.tpl indicates that it's {$category.description} but that doesn't print out anything. I used

Code: Select all

{get_template_vars}
and the category name was

Code: Select all

$param_junk
-- this is confusing to me. The name prints on the following code, but the description does not.

Code: Select all

{if $entry->categories}
<div class="CGBlogSummaryCategory">
<h3>List of Categories</h3>
{strip}{$category_label}
 {foreach from=$entry->categories item='category'}
   {$category.name}&nbsp;
   {$category.description}
 {/foreach}
{/strip}
</div>

{/if}

SOLVED. Opened up a couple files in the module and added it.
Last edited by carasmo on Mon Aug 10, 2015 7:38 pm, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: CGBlog {$category.description} doesn't print anything

Post by velden »

Try:

Code: Select all

...
{foreach from=$entry->categories item='category'}
   <pre>{$category|print_r}</pre>
   {$category.name}&nbsp;
   {$category.description}
 {/foreach}
...
to find more info about available properties of category.
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: CGBlog {$category.description} doesn't print anything

Post by Rolf »

Yeah I have noticed this too, the category description field isn't passed to the front end. Not sure it this is a bug or a "feature"... May be calguy1000 can shed a light on it.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm
Location: Florida

Re: CGBlog {$category.description} doesn't print anything

Post by carasmo »

velden wrote:Try:

Code: Select all

...
{foreach from=$entry->categories item='category'}
   <pre>{$category|print_r}</pre>
   {$category.name}&nbsp;
   {$category.description}
 {/foreach}
...
to find more info about available properties of category.

I did this and I got this for the Video category.

Code: Select all

Array
(
    [id] => 1
    [name] => Video
)
1
It's a confusing thing, I wanted to use it for the meta description on the category pages, I had to comment out the field in the .tpl file as the client will be confused too.
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm
Location: Florida

Re: CGBlog {$category.description} doesn't print anything

Post by carasmo »

Is this relevant to how to get the category?

Code: Select all

removed
I found this in the action.admin_editcategory.php file.

If so, any ideas?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: CGBlog {$category.description} doesn't print anything

Post by velden »

Please remember we do NOT allow hacks to be posted in this forum.

You can file a bug report or feature request in the forge:
http://dev.cmsmadesimple.org/projects/cgblog
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm
Location: Florida

Re: CGBlog {$category.description} doesn't print anything

Post by carasmo »

That wasn't a hack, it was just some of the php that I thought was relevant to the question.
Post Reply

Return to “Modules/Add-Ons”