Hello,
How can I add attributes to the <img> tags for the posts?
Sorry if I am ignorant but i cannot seem to find where to edit the <img> tags...
Thanks for any help..
Hello,
How can I add attributes to the <img> tags for the posts?
Sorry if I am ignorant but i cannot seem to find where to edit the <img> tags...
Thanks for any help..
I tried adding the variable to the PhotoQ setting -> The_Content -> Image Link Main > Linking to Original attributes, but that adds the variable to the < a > tag.
How can I change the <img> tag variables? Is this possible?
Thanks!
The reason I am asking is I found a script that will let people hotlink to my images.
http://www.funscripts.net/javascript-widgets/
But I cannot find where to add the variable to the <img src> tag.
Thanks for your help...
forestwander,
you cannot find it because it is not implemented :-).
i buy your point of why this should be added, so i thank you for your suggestion, move this thread to the "requests" section of the forum and add it to my to-do-list.
until this goes into photoq you can hack the code to have it right away, and it shouldn't even be difficult:
function generateImgTag($sizeName, $class)
{
...
}
function generateImgTag($sizeName, $class)
{
return '<img onmouseup="hl2l(event);" width="'.$this->_s...
hope this helps
I searched and found the location and added the code. But, it does not generate the tag with the new attribute for new images (or for existing, which I figured it would not change any existing).
Any ideas why? Or should I just wait until you can make the update to the plugin?
Thank you again!
forestwander,
it definitely shoud! i just tested and in my case it does.
if you added them to generateImgTag() are you sure you are using the "single image" setting and not the "image link" setting in your photoq settings for the corresponding view?
Under the "Views" section I have
the_content
Image Link (is selected) and MAIN linking to ORIGINAL, link having following attributes: target="_blank" onmouseup="hl2l(event);"
the_excerpt
Single Photo: Main
I am only concerned with the image that is on the individual post not the original.
The image link attributes work for Internet explorer and the pop up box works but not firefox.
Is this setting correct?
"I am only concerned with the image that is on the individual post not the original."
I would like to leave the link in place so that the visitor can click the linked image and the original open. The original images are huge! 21 MP in size. This is what makes my site unique.
But if they right click the image thumbnail (not the small ones but the large one which is 550x375)in the post then the pop-up with code should function as does in IE.
OK, I see where to add it for the link.
I went ahead and added it for the link like this.
function generateImgLink
{
..........<img onmouseup="hl2l(event);" width="'.$this->
However, it the box only pops up for a second and then goes away.
I am wondering if this is because I have the java script pop up defined in the link tag as well from the photoQ settings...?
So the onmouseup="hl2l(event);" is in the Link tag and in the <img> tag. If I take it out of the tag then it will not work for all of my existing images in IE (as it does now) although it would work for all newly added images in both IE and FF. But with over 1800 images I think I would rather just let it work for IE and...
Maybe I should just wait till you can add the field in the options???
If you need to see what I mean... right click the image in this example.
This is a cropped image so it is not a good example of why I link to the original.
http://www.forestwander.com/2009/07/hawk-face-beak-feathers/
Is there anyway to take the onmouseup="hl2l(event);"
out of the link tag attributes without updating every post?
In other words make this
Image Link (is selected) and MAIN linking to ORIGINAL, link having following attributes: target="_blank" onmouseup="hl2l(event);"
Like this
Image Link (is selected) and MAIN linking to ORIGINAL, link having following attributes: target="_blank"
Without updating every post?
Or should I just wait???
Thanks for your help.
I am wondering if this is because I have the java script pop up defined in the link tag as well from the photoQ settings...?
yes i think this is the problem. at least if i look at the example image you gave and remove the one from the < a > tag with firebug, it works as it should.
Is there anyway to take the onmouseup="hl2l(event);"
out of the link tag attributes without updating every post?
well no, of course not as it is part of the post. however, updating doesn't mean updating by hand with photoq. photoq is designed such that most of the changes (e.g. changes in the view, which we are talking about here) are applied to all posted posts as well. so photoq updates every posted post automatically. all you should have to do is change the view to what you want (i.e. without the onmouseup event) and then save the photoq settings. photoq will then go through all your posts and update each one. at the same time it will also add the onmouseup to the img tags if you changed this in the functions we discussed about above. attention: considering that you have a huge number of posts, i strongly recommend that you backup your website (database and all the image folders original, main, thumbnail, etc) before doing this - you never know what can go wrong.
another thought just crossed my mind. what you want to do is basically add the onmouseup to every img tag there is on your site. i guess you could do this very easily in a dynamic way when the page loads via javascript (e.g. jQuery). like this the onmouseup is not part of the post and if you one day decide to take it away, you just delete the javascript from your theme and you don't have to update all the posts.
as of v1.8 hacks like this are no longer required. You can achieve the same by using the new freeform view option.
This topic has been closed to new replies.