Hi Stefan! I played around with your solution and got it working just fine! I created a Objekt - Java Extension on the page where I have the rss makro and placed your script: { var rssLinks = $$('.rssitemtitle a'); //the css selector for links in the 'div's generated by the {{rss}} macro. rssLinks.each(function(link){ link.writeAttribute('target', '_blank'); }); } in there, and now it works just fine. I still think it is a nice option to have within the makro and will try and post a Jira accordingly. Thanks for all the help, Wouter
Hi Wouter,
Vincent's solution is the most correct one from the Java development and best practice point of view. But for some less experienced developers it might be a bit difficult imho. So I can think of a way to work around this (i.e. do a quick dirty fix). An easier solution, though not the most elegant one, would be to write a piece of Javascript code to be executed on page load. It should search fpr links in the RSS block(s) and write the "rel" or "target" attribute to "_blank". The only problem is that you should include that script via xwiki.jsx.use(...) on each page you want this feature on.
The Javascript could look something like this:
document.observe("xwiki:dom:loaded") { var rssLinks = $$('.rssitemtitle a'); //the css selector for links in the 'div's generated by the {{rss}} macro. rssLinks.each(function(link){ link.writeAttribute('target', '_blank'); }); }
I hope it helps. Cheers! Stefan. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users