Hi
I'm trying to get my navigation to include the "target" attribute of redirect pages, e.g. target="_blank" or in other words honour the setting of the "New Window?" item in the redirect page's details.
Is there a keyword I can call for this?
Keyword for link target="_blank"
Not that simple. Lastly I wanted the same functionality.
After You add classes (look in mentioned topic) You’ll need to add jQuery to Your site and add script:
$('a.redirect_page').attr('target', '_blank');
Hm, thanks uam, seems it might not be simple.
This method would affect redirects in my navigation regardless of their intended "new window" behaviour, which I don't think is going to work for me.
The redirect page must contain the information about its target window as attributes, I was rather hoping I could call them with keywords.
The New Window option does not control the target attribute, rather the javascript for opening a 'pop-up'.
Interestingly the target attribute, which was deprecated, has made a return in the HTML 5 specifications.
[quote]
Interestingly the target attribute, which was deprecated, has made a return in the HTML 5 specifications.
[/quote]
That is good news. I always preferred _blank over a js solution. JS pop ups are almost always blocked.
Also it doesn't matter so much whether the New Window directly controls the target attribute, as that it is an attribute of the asset that I can't call upon.
Really the asset/menu combination should be smarter - if I have a "New window" asset in my menu it should open a new window without workarounds, but it is pretty disappointing that I can't do it even with a workaround. <_<
My suggestion is to create a metadata field "New window", which you can mark as 'yes' if you want target="blank" to be printed. Then for your redirect assets, use a paint layout conditional to print out target="blank" if the metdata field is marked as yes.