-
AuthorPosts
-
metastorm Friend
metastorm
- Join date:
- October 2012
- Posts:
- 48
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 6
- Thanked:
- 5 times in 1 posts
December 17, 2012 at 9:59 am #183166Hi,
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 FriendHeR0
- Join date:
- August 2011
- Posts:
- 3626
- Downloads:
- 0
- Uploads:
- 61
- Thanks:
- 33
- Thanked:
- 588 times in 549 posts
December 18, 2012 at 9:42 am #476634Hi 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 Friendmetastorm
- Join date:
- October 2012
- Posts:
- 48
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 6
- Thanked:
- 5 times in 1 posts
December 18, 2012 at 1:32 pm #476671Hi 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 FriendHeR0
- Join date:
- August 2011
- Posts:
- 3626
- Downloads:
- 0
- Uploads:
- 61
- Thanks:
- 33
- Thanked:
- 588 times in 549 posts
December 19, 2012 at 3:06 am #476725Hi 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 Friendmetastorm
- Join date:
- October 2012
- Posts:
- 48
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 6
- Thanked:
- 5 times in 1 posts
December 19, 2012 at 10:20 am #476778Hi 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_contentcategoryBut 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 FriendHeR0
- Join date:
- August 2011
- Posts:
- 3626
- Downloads:
- 0
- Uploads:
- 61
- Thanks:
- 33
- Thanked:
- 588 times in 549 posts
December 20, 2012 at 3:48 am #476858Hi 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 Friendmetastorm
- Join date:
- October 2012
- Posts:
- 48
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 6
- Thanked:
- 5 times in 1 posts
December 20, 2012 at 8:50 am #476900Hi HeR0,
Check PM, pleasemetastorm Friendmetastorm
- Join date:
- October 2012
- Posts:
- 48
- Downloads:
- 0
- Uploads:
- 8
- Thanks:
- 6
- Thanked:
- 5 times in 1 posts
December 21, 2012 at 11:54 pm #477127Hi 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? 🙂
-
AuthorPosts
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