my_calendar plugin with target="_blank"

Creating and modifying plugins.
Post Reply
ju
Regular
Posts: 50
Joined: Wed Oct 01, 2008 4:27 pm

my_calendar plugin with target="_blank"

Post by ju »

I use the "My calendar" plugin (serendipity_event_mycalendar, serendipity_plugin_mycalendar) in my blog with a Bullet Proof template. And I would like to have all links in "My calendar" open a new page (i.e. target="_blank"). What would I have to change to achieve this?

//edited the typo in the subject
Last edited by ju on Tue Dec 13, 2011 8:07 am, edited 1 time in total.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: my_calendar pluging with target="_blank"

Post by yellowled »

ju wrote:And I would like to have all links in "My calendar" open a new page (i.e. target="_blank"). What would I have to change to achieve this?
target="_blank" is obsolete. Please consider letting your visitors choose how to open links.

YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: my_calendar pluging with target="_blank"

Post by garvinhicking »

Hi!

Let me start with: I don't really like target=blank. I believe the user should have control over where links open, not the website.

Having said that: The plugin is not templated, so you'd have to edit the PHP code and change the <a> tags accordingly.

Another option is to use Jquery like this:

Code: Select all

jQuery('.container_serendipity_plugin_mycalendar a').attr('target', 'blank');
(Untested, though)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
ju
Regular
Posts: 50
Joined: Wed Oct 01, 2008 4:27 pm

Re: my_calendar pluging with target="_blank"

Post by ju »

Let me clarify: some links from my calendar lead to other websites. This is confusing for the users, as they don't know why they don't see my blog any more. Doesn't happen to advanced users, because they know how to handle their browswers and mice, but normal users just click and get lost.

//ps: Thank you Garvin! I'll make a backup-copy and try to edit.
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: my_calendar pluging with target="_blank"

Post by onli »

How do you come to that assumption? See http://www.useit.com/alertbox/990530.html, it's the other way around (according to usability-experts who tested this).
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: my_calendar pluging with target="_blank"

Post by yellowled »

onli wrote:How do you come to that assumption? See http://www.useit.com/alertbox/990530.html, it's the other way around (according to usability-experts who tested this).
First of all (personal opinion), not everything Jacob Nielsen posts is automagically right. :)

Second, and yes, I am aware that this can be twisted and is kind of subjectiv, target is a relict from the web stone age which was originally intended to be used with frame(set)s. It was not actually intended to open new browser windows or tabs. The same functionality (if one wants to use it) can be achieved using JS.

Third, and again that's basically a personal opinion (but one a lot people share), I think the user should have control about what happens in the browser according to his individual settings, even if a minority of users could be confused by that behaviour.

(And fourth, it's friggin' annoying if a browser does not behave as expected, but that hardly counts as an argument. :mrgreen:)

YL
ju
Regular
Posts: 50
Joined: Wed Oct 01, 2008 4:27 pm

Re: my_calendar pluging with target="_blank"

Post by ju »

onli wrote:How do you come to that assumption?
because they told me.

I remember that back in the days of Netscape 2.x or 3.x I was sometimes annoyed about websites opening new pages because the browsers tended to crash when more than a few windows were open. (And I also remember those javascript "jokes" that opened many new windows and crashed not only the browser but also the OS).

Today browsers have tabs and users can chose if they perfer new tabs or new windows.

The problem with the my_calendar plugin is special. When users click on links like www.example.com/archives/1234 or /categories/ they can read the article and continue reading the next article afterwords or navigate to another part of the website using the site's navigation. Users expect the same behaviour when the click on the items in "my calendar". Their expectation will be met if every item of "my calendar" links to an article within the archives but it will not be met, when the link leads to another site.

When I put links under my articles I always show where they lead to, so people are aware that they will see the New York Times or Google or whatever, when they click it. In "my calendar" they see the text but not the link. (Only few users look into the status bar.)

So, ideally, there would be different solutions for links within the same site and links to other sites, maybe even with an alert "If you click on this link you leave www.example.com. Please, use your browser's back button to return"
Post Reply