Hi all,
I'm looking for help with what I think is a pretty easy question - but I can't quite figure it out. I've installed Zenphoto on my website, and I'd like the Zenphoto credit link at the bottom of my gallery to open the Zenphoto website in a new window.
On my theme's index.php page, the function calling the zenphoto credit link is <?php printZenphotoLink(); ?>. Is there a way I can make this link open up in a new page without editing the zp-core files?
Thanks so much for any advice!
Elisabeth
Comments
I went into the zp-core folder, found the "templates-functions.php" file, opened it up in Dreamweaver — yeah, yeah, I know… but I'm 64, give me a break :-) — searched for "printZenphotoLink" and then changed it to read:
… href=\"http://www.zenphoto.org\" target=\blank title=\"A simpler web photo album\ …
Note: the only thing I added was "target=\blank"
I assume that since I haven't figured out where to "copy the code to your theme", I will have to make the change any time there is a version change.
I would appreciate it if someone would kindly explain the last piece of this puzzle for me.
It would have been `target="\blank\"` in that context btw. The quotes are important.
The zenphoto link only links to our website. All themes have the `printZenphotoLink()` function at the bottom of the theme files , the main ones are index.php, album.php and image.php (detailed info about that on the theming tutorial). You can replace that function call with a plain link of course that opens automatically in a new window.
Sidenote: Generally it is best practice to leaeve opening in a new window to the user as he can control that himself with his browser (via context menu or ALT+left click). Especially as most browsers use the more convenient tabs.
I totally agree with your sidenote. I (finally) made the decision some time ago to leave the matter to users. In some cases, due to the expected audience, it required an explanation of the Shift or Ctrl-click function.
I'm not sure how I got in on this except as I was looking for something, I came across this post and it bothered me that, as happens too many times in forums, people who know how to do something assume we all do. So I decided to see if I could figure it out.
BTW target=\blank without the quotes worked. Are the quotes necessary or is it just best practice?
Off topic a bit: speaking of hacking core files, is it safe to assume there is no way to implement a custom © without hacking the zp-core/watermarks folder?