4

I am using Articles - Categories module in my Joomla website (my custom template) and it works great, meaning that it lists all articles with intro text from the categories I want.

But it does not show the intro-image of these articles although I defined them in each article "Image and links" tab. Is there a way to show intro images?

I suppose that I need to do some template overriding.

You can see it here:

http://nolimitsbl.com/teimc/index.php/l ... tovarivaci

I just want to mention that bold black titles are categories titles and bellow them are listed articles with intro texts.

Need help!

Thank you!

3 Answers 3

3

Yep, I would also do the template override.

Fetch the file components/com_content/views/categories/tmpl/default_items.php and copy it to <your_template>/html/com_content/categories/default_items.php. (I am not totally sure about the correct name, see the Joomla docs about this)

Now you can edit it. In the file components/com_content/views/category/tmpl/blog_item.php I found <?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>, this could perhaps make the deal.

Nice big machines, BTW. :)

1
  • Solved! I put the code: <?php $images = json_decode($item->images); ?> <img class="image_intro" src="<?php echo $images->image_intro; ?>" alt="<?php echo $images->image_intro_alt; ?>"/> after the following code in my overriding file of the joomla core file modules/mod_articles_categories/tmpl/default.php and intro images of articles shown up in module Articles-Categories listing. If anyone has other solutions, come on shoot...
    – Miha
    Commented Jul 22, 2015 at 9:45
3

Solved! I put the code:

<?php $images = json_decode($item->images); ?> <img class="image_intro" src="<?php echo $images->image_intro; ?>" alt="<?php echo $images->image_intro_alt; ?>"/>

after the following code in my overriding file of the joomla core file:

modules/mod_articles_categories/tmpl/default.php

* @subpackage  mod_articles_category
 *
 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

?>
<ul class="category-module<?php echo $moduleclass_sfx; ?>">
    <?php if ($grouped) : ?>
        <?php foreach ($list as $group_name => $group) : ?>
        <li>
            <ul>
                <?php foreach ($group as $item) : ?>    
                    <li>   

and intro images of articles shown up in module Articles-Categories listing. If anyone has other solutions, come on shoot...

0

Path should actually be: modules/mod_articles_category/tmpl/default.php

One more important suggestion, place the changed files in your own template in /[yourTemplateName]/html/mod_articles_category/default.php

This way the file will not be removed when upgrading Joomla.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.