Tutorial: Open site in new window, target="blank"

Propose here your templates, your plugins or ask one.
All tutorials available for Arfooo Directory are available in this category.

Moderator: effi

Tutorial: Open site in new window, target="blank"

Postby Arf » Fri Dec 05, 2008 8:46 am

Tutorial to open site in new window

Go in folder :
templates/arfooo/
or
templates/yourtemplate/

and modify the following files:

Open file :
templates/arfooo/site/item.tpl

Search to the line 15:
Code: Select all
<a href="{$site.url}" title="{$site.siteTitle}" class="link_black_grey_bold" onclick="return visitSite({$site.siteId})">{$site.siteTitle}</a>

Changes by:
Code: Select all
<a href="{$site.url}" title="{$site.siteTitle}" target="_blank" class="link_black_grey_bold" onclick="return visitSite({$site.siteId})">{$site.siteTitle}</a>



Open file :
templates/arfooo/site/details.tpl

Search to the line 37:
Code: Select all
<a href="{$site.url}" rel="nofollow" class="link_black_grey_bold" onclick="return visitSite({$site.siteId})">

Changes by:
Code: Select all
<a href="{$site.url}" rel="nofollow" target="_blank" class="link_black_grey_bold" onclick="return visitSite({$site.siteId})">


Search to the line 52:
Code: Select all
<a href="{$site.url}" title="{$site.siteTitle}" class="link_black_grey_bold" onclick="return visitSite({$site.siteId})">{$site.siteTitle}</a>

Changes by:
Code: Select all
<a href="{$site.url}" title="{$site.siteTitle}" target="_blank" class="link_black_grey_bold" onclick="return visitSite({$site.siteId})">{$site.siteTitle}</a>


Search to the line 83:
Code: Select all
<a href="{$site.returnBond}" title="{$site.returnBond}" class="link_black_grey">{$site.returnBond}</a>

Changes by:
Code: Select all
<a href="{$site.returnBond}" title="{$site.returnBond}" target="_blank" class="link_black_grey">{$site.returnBond}</a>


Arf ;)
Arf
Site Admin
 
Posts: 212
Joined: Fri Mar 14, 2008 6:51 pm

Re: Tutorial: Open site in new window, target="blank"

Postby orkosk » Mon May 10, 2010 6:32 am

The TARGET attribute is deprecated. There is a theoretical possibility that a browser only supports the HTML 4.01 Strict specification and therefore does not support TARGET. That same browser might support some other Javascript functionality, like window.open to actually open links or other things in new windows. However, I don't want to recommend that. The much weirder part is of course that you are using Javascript to insert attributes, because your document wouldn't validate as HTML 4.01 Strict otherwise. Plain wrong.

Opening a link a new window is evil. Read Day 16: Not opening new windows to understand why. Reading the first two points in the The Top Ten New Mistakes of Web Design (from 1999) might also give you an idea.

My argument made earlier about the TARGET being deprecated doesn't make much sense of course. Eventually, we will use it again for the OBJECT element in XHTML documents when some patch is applied.
orkosk
 
Posts: 1
Joined: Mon May 10, 2010 6:20 am

Re: Tutorial: Open site in new window, target="blank"

Postby droven4567 » Thu Nov 11, 2010 8:02 am

Admittedly I am behind the curve on this (or I missed a memo). However, it seems to me that the new solution is really a crooked (and not so short) path just to get a link to open in a new window. While I use Wordpress/Thesis about 99% of the time, what is the solution for straight HTML sites? Are you implying that if I have an HTML site (or I don’t wish to create shortcodes, the only other solution is Jquery or some other Javascript code?
droven4567
 
Posts: 1
Joined: Tue Nov 09, 2010 5:52 am

Re: Tutorial: Open site in new window, target="blank"

Postby centaur » Sun Jun 26, 2011 4:53 pm

One thing to note is that now: "The target attribute for the a and area elements is no longer deprecated, as it is useful in Web applications, e.g. in conjunction with iframe."

From "HTML5 differences from HTML4 W3C Working Draft 25 May 2011" http://www.w3.org/TR/html5-diff/#new-attributes


Obviously it was altered after your message. ;-)
centaur
 
Posts: 1
Joined: Sun Jun 26, 2011 4:51 pm


Return to Templates, plugins and tutorials

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

 
Copyright © arfooo.net  2007 - 2010  -  All rights reserved.
Arfooo website group: petites annonces gratuites   voyance en direct - tirage tarot   Consultant en référencement
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group | phpBB SEO
cron