-
AuthorPosts
-
October 13, 2012 at 11:04 am #181405
Hello everyone.
I am facing some kind of problem with the title of the images imported from feedgator.
When i use Joomla native content plugin, titles (from some sites) display as follows :When i use the K2 content plugin, the title seems broken when i hover the cursor over the image like this :
How could i remove the title or fix if possible, since the titles of images from other sites appear to be ok?
FYI I am on localhost.
Any suggestions?
Thanks in advance….P.S.
I could not find a relative thread…-
HeR0 Friend
HeR0
- Join date:
- August 2011
- Posts:
- 3626
- Downloads:
- 0
- Uploads:
- 61
- Thanks:
- 33
- Thanked:
- 588 times in 549 posts
October 15, 2012 at 7:15 am #470067Hi Ariablack,
Because the title is processed by htmlspecialchars function before it is displayed. Hence, you should check k2 content plugins which might use htmlspecialchars to proceed the title.
Regards,
October 18, 2012 at 4:03 pm #470459Thank you for your answer.
It is not only the K2 content plugins, it is also the Joomla! native ones, as shown in picture.
Just with K2 that happens when hovering mouse whilst with Joomla! ones displays title like that onto picture.
This does not happen with all site feeds, but with feeds from specific sites, so i guess it’s something with the feed they provide. (Oh i have to include them)As i am no php expert could you please point me to the file i have to edit in order to get it working (or erase the title display whatsoever)……..?
arucardx Friendarucardx
- Join date:
- July 2010
- Posts:
- 346
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 21
- Thanked:
- 138 times in 104 posts
October 18, 2012 at 4:22 pm #470461Ah… hmmm…. I’ve been thinking of trying to give this a shot at fixing, but I forgot about it. Let me just post this here so I’ll remember about it, while I go look at the code. Should just be a easy fix if you have no issues with removing the on hover caption.
Edit: Oh wait. I forgot to ask. Do you need to fix this on K2 or Joomla? Both requires different fix.
October 18, 2012 at 4:24 pm #470462Thanks for looking into it!
Waiting for your reply!arucardx Friendarucardx
- Join date:
- July 2010
- Posts:
- 346
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 21
- Thanked:
- 138 times in 104 posts
October 18, 2012 at 5:37 pm #470473edit sry, I mess up my post zzz. need to rewrite it.
arucardx Friendarucardx
- Join date:
- July 2010
- Posts:
- 346
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 21
- Thanked:
- 138 times in 104 posts
October 18, 2012 at 5:41 pm #470476Sry for the wait, I was starring at the right code but misunderstood it for some reason lol. But here’s the fix for both Joomla and the K2. Could be wrong, could be right, I’m not sure since I have no Unicode article to test with.
Joomla: Open html/com_content/category/blog_item.php and look for this block of code
[PHP] <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); ?>”/>[/PHP]Replace it with
[PHP]<img src=”<?php echo htmlspecialchars($images->image_intro); ?>” />[/PHP]Actually wrote a rewrite code for this to display the unicode properly but after looking at your screenshot, it seems your article title and caption is the same so I doubt you need the caption effect. Might as well remove the caption.
Now for K2, go to html/com_k2/ja_wall/category_item.php and look for this block of code.
[PHP] <div class=”item-image”>
<a class=”item-link” href=”<?php echo $this->item->link; ?>” title=”<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>”>
<img src=”<?php echo $this->item->image; ?>” alt=”<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>” />
<span> </span>
</a>
</div>[/PHP]Replace it with this
[PHP] <div class=”item-image”>
<a class=”item-link” href=”<?php echo $this->item->link; ?>” >
<img src=”<?php echo $this->item->image; ?>” />
<span> </span>
</a>
</div>[/PHP]Problem solved for K2 =) Doubt there’s any code error, didn’t test it but looks good to me.
P.S: Sry edit twice, the Joomlart forum screw up my first post then I got sleepy and wrote the wrong code 2nd round >_< But now it’s fixed correct for sure.
1 user says Thank You to arucardx for this useful post
October 20, 2012 at 9:28 am #470592Thank you so much for all your time and effort arucardx!!
The problem was fixed for joomla, but unfortunately not for K2.
I understand your code but still struggling with php 😉arucardx Friendarucardx
- Join date:
- July 2010
- Posts:
- 346
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 21
- Thanked:
- 138 times in 104 posts
October 20, 2012 at 9:30 am #470593What’s wrong with the code for K2? The code I gave you has it’s caption entirely stripped. If you can show me the problem, I can try to fix it for K2.
October 20, 2012 at 9:35 am #470594It’s just like the 2nd screenshot i have posted.
When hovering mouse over image of the article it displays wrong…:((arucardx Friendarucardx
- Join date:
- July 2010
- Posts:
- 346
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 21
- Thanked:
- 138 times in 104 posts
October 20, 2012 at 9:41 am #470595It seems you are editing the wrong K2 file. Can you check if you are using JA Wall, JA Showcase or JA Blog then modify the category_item.php in the correct folder?
October 20, 2012 at 9:53 am #470596Well, you were right about that…
i am using JA Showcase, so went ahead and changed that block and no change again.
Really appreciate your help.Edit:The display was removed entirely.
Works for me! -
AuthorPosts
Viewing 12 posts - 1 through 12 (of 12 total)This topic contains 12 replies, has 3 voices, and was last updated by arialblack14 12 years, 1 month ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum
-