Page 1 of 1
[SOLVED]CGBlog {$category.description} doesn't print
Posted: Sun Aug 09, 2015 6:09 pm
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
and the category name was
-- 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}
{$category.description}
{/foreach}
{/strip}
</div>
{/if}
SOLVED. Opened up a couple files in the module and added it.
Re: CGBlog {$category.description} doesn't print anything
Posted: Mon Aug 10, 2015 7:54 am
by velden
Try:
Code: Select all
...
{foreach from=$entry->categories item='category'}
<pre>{$category|print_r}</pre>
{$category.name}
{$category.description}
{/foreach}
...
to find more info about available properties of category.
Re: CGBlog {$category.description} doesn't print anything
Posted: Mon Aug 10, 2015 12:32 pm
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.
Re: CGBlog {$category.description} doesn't print anything
Posted: Mon Aug 10, 2015 2:56 pm
by carasmo
velden wrote:Try:
Code: Select all
...
{foreach from=$entry->categories item='category'}
<pre>{$category|print_r}</pre>
{$category.name}
{$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.
Re: CGBlog {$category.description} doesn't print anything
Posted: Mon Aug 10, 2015 3:25 pm
by carasmo
Is this relevant to how to get the category?
I found this in the action.admin_editcategory.php file.
If so, any ideas?
Re: CGBlog {$category.description} doesn't print anything
Posted: Mon Aug 10, 2015 3:49 pm
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
Re: CGBlog {$category.description} doesn't print anything
Posted: Mon Aug 10, 2015 4:11 pm
by carasmo
That wasn't a hack, it was just some of the php that I thought was relevant to the question.