test
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • marketinghits Friend
    #826034

    To display images in category view is it possible to use the first article image instead of an intro image?

    Thanks for your help
    Brian

    Adam M Moderator
    #826811

    Hi @marketinghits,

    First, it’s not recommend to do that, the proper way is to specify intro / full image via article manager.

    Since the template is built within JLayout, it’s a bit complicated to choose display image from article as intro only when Intro image is not specified. The only option is to open file templates/ja_magz_ii/html/com_content/category/blog_item.php and look for this code :

    <?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>

    and replace with :

    <?php
        $first_image = '';
        if ((preg_match('/<img[^>]*>/i', $this->item->fulltext, $matches ) == 1))
        echo $first_image = $matches[0];
    ?>
Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 1 reply, has 2 voices, and was last updated by  Adam M 9 years ago.

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