How can I configure programmatically a node object to open in a new tab? I thought maybe in the $node->path
array?
I don't see where and how I can achieve this... There is nothing such as a rendered <a>
on which I can add a target="_blank"
.
EDIT (more specific situation):
I've got a content type "news". It is possible to create news in 2 different ways:
- An editor user creates manually through the admin interface (basic).
- A custom module imports data from external RSS feeds everytime a piece of news is published in it.
I've got a view that display the list of news (just title, truncated text, date, logo...). When you click on a news' title, you access the full node view (normal). If it is an internal news (created manually), it displays normally. If it is an imported news, however, I redirect using drupal_goto to the source of the news (that I saved on node creation).
I want to make this very redirection in a new tab. It's quite complicated because it is originally an internal link (node/nid) that redirects to an external link (http://www.sourcesite.com).
I can make the difference between an imported/not imported node in the hook_preprocess_views_view
. But I can't assign it something like a target _blank or whatever it exists to make this node opened in a new tab.