test
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • famelink Friend
    #128220

    Hi,

    I am currently properly displaying the category description when viewing a category. However, when I click the link to view an individual article within a category, I would also like to include the category description in the article.

    I’ve tried to include the following code in the com_content/article/default.php file, but no success:

    <?php if ($this->params->def('show_description', 1) || $this->params->def('show_description_image', 1)) :?>
    <div class="jazin-pagedesc">
    <?php if ($this->params->get('show_description_image') && $this->section->image) : ?>
    <img src="<?php echo $this->baseurl . '/' . $cparams->get('image_path') . '/'. $this->section->image;?>" align="<?php echo $this->section->image_position;?>" hspace="6" alt="" />
    <?php endif; ?>
    <?php if ($this->params->get('show_description') && $this->section->description) : ?>
    <?php echo $this->section->description; ?>
    <?php endif; ?>
    </div>
    <?php endif; ?>

    any help appreciated…

    Menalto Friend
    #269328

    Did you manage to get this solved? If you did please mark this as solved, in not reply here and we will try to help you out.

    famelink Friend
    #269582

    Yes, I did get this resolved. Not as clean as I had hoped, but it works for me.
    Basically in the templates folder I modified the article default.php file (templatesja_teline_iihtmlcom_contentarticledefault.php) and added the following code:

    [PHP]<?php if ($this->params->get(‘link_section’)) : ?>
    <table>
    <tr>
    <td width=”60%” valign=”top” class=”jazin-pagedesc”>
    <?php if ($this->category->image) : ?>
    <img src=”images/stories/<?php echo $this->category->image;?>” align=”<?php echo $this->category->image_position;?>” hspace=”6″ alt=”<?php echo $this->this->category->image;?>” />
    <?php endif; ?>
    <?php echo $this->category->description; ?>
    </td>
    </tr>
    </table>
    <?php endif; ?>[/PHP]

    however the category object is not available by default, so both in the joomla article model and view I had to made some additional changes to make the category object available.

    It works for me and I can turn the category description on/off for an article by setting the “Section Title Linkable” option which I wasnt using anyway otherwise…

Viewing 3 posts - 1 through 3 (of 3 total)

This topic contains 3 replies, has 2 voices, and was last updated by  famelink 16 years, 2 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum