Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • metastorm Friend
    #183166

    Hi,

    I need to remove any style and class image tags from image thumbnails on category blog page.
    The reason is – if in original article image has f.e.

    style=”display: block; margin-left: auto; margin-right: auto; width=600px; height=300px

    then this style will be remain at the small thumbnail image in category blog view.
    Small image 210×120 (by JaThumbnail) + original style (width=600px; height=300px) = oversized image and broken design :((

    Also with class tag. Cat blog view image gets all class information like class=”caption”. Captions are welcome in article but in Category blog they are not. Yes, I can disable showing caption by adding css (found at forum)

    .blog p.img_caption {
    display: none;
    }

    but this only about one class “caption”. How to remove ANY class?

    HeR0 Friend
    #476634

    Hi Metastorm,

    Open file templatesja_nexhtmlcom_contentcategoryblog_item.php then you can find block code as below

    <?php if (isset($images->image_intro) and !empty($images->image_intro)) : ?>
    <?php $imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro; ?>
    <div class="img-intro-<?php echo htmlspecialchars($imgfloat); ?>">
    <img
    <?php if ($images->image_intro_caption):
    echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
    endif; ?>
    src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/>
    </div>
    <?php endif; ?>

    Regards

    metastorm Friend
    #476671

    Hi HeR0,

    I already tried to delete this block entirely, but nothing changes at all – seems this code does just not work. :(( And it’s placed between title output and introtext output.

    The code for image output in the beginning of the file:

    <?php
    //get images
    $regex = '#<img[^>]*>#';
    $image = '';
    if (preg_match ($regex, $this->item->introtext, $matches)) {
    $image = $matches[0];
    $this->item->introtext = str_replace ($image, '', $this->item->introtext);
    }
    ?>
    <?php if ($image) : ?>
    <div class="article-image">
    <?php echo $image ?>
    </div>
    <?php endif; ?>

    HeR0 Friend
    #476725

    Hi Metastorm,

    Which K2 blog or Article blog page are you mentioning? Did you clean all cache after edit code of that file? In previous my post, you can see ‘class=”caption” which you can edit.

    You can edit blog page in overridden files in template folder: templatesja_nexhtmlcom_contentcategoryblog_it em.php and ja_nexhtmlcom_k2templatesnex_blogblog_item.php

    Regards

    metastorm Friend
    #476778

    Hi HeR0,

    There is no misunderstanding – I’m about Category Blog view page, com_content, cache disabled.
    I tried to edit templatesja_nexthemesthemehtmlcom_contentcategoryblog_item.php
    I have override of original file in Themes with disabled print and mail icons output, so this file really works.
    Also I tried to edit original file in templatesja_nexhtmlcom_contentcategory

    But code block your mentioned does not have any effect on output. I tried to change class name and delete entire block
    <?php if … <?php endif; ?> without any effect. :((

    Please take a look at the beginning of the blog_item.php, start from //get images and then <?php echo $image ?> – this line make an image with all tags, as I see.

    HeR0 Friend
    #476858

    Hi Metastorm,

    Could you post url of that Category blog page? If it is exactly blog page, I’m sure that your change will effect on output.

    Regards

    metastorm Friend
    #476900

    Hi HeR0,
    Check PM, please

    metastorm Friend
    #477127

    Hi Her0,

    I figured out that I can block images oversizing by this code in css:

    .blog .item .article-image img {
    width: 210px !important;
    height: 120px !important;
    }

    Seems to work. Is this correct way by your opinion? 🙂

    HeR0 Friend
    #477133

    Hi Metastorm,

    Yes, It can help to resolve your issue.

    Regards

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

This topic contains 9 replies, has 2 voices, and was last updated by  HeR0 11 years, 11 months ago.

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