17452 Posts in 4473 Topics by 1971 members
|Go to End|
16 July 2007 at 3:37pm
I'm wondering whether there's an easy way to add a target="_blank" to an item that's part of the menu generated by SS?
I'm working on a site that requires an external forum, and as far as I can see the only option is to add a page called "Forum" and make that page redirect to the forum. Still, the link is part of the main menu, and the content editor doesn't let me edit anything except for the actual URL.
Maybe this is covered somewhere in the tutorials, but I can't seem to find it..
Thanks for any pointers!
16 July 2007 at 3:58pm
At the moment the insert-link interface doesn't allow opening in new page (if you really want, you can go an read up about XHTML 1.1 since there is a strong philosophy behind the idea that _blank is a bad idea).
The 'demo' link on silverstripe.com's main menu just uses a Redirecting Page to go to demo.silverstripe.com ...
16 July 2007 at 5:14pm
Thanks for the quick reply!
I wish I could do everything according to brave new webstandards, but in this case it's the client who gets to call the shots.. :/
16 July 2007 at 9:00pm
you could try this solution rather then _blank http://weblogtoolscollection.com/archives/2004/01/02/targetblank-xhtml-10-strict-conversion/
but you still need someway to add a rel tag to a link so you might want to try hard coding the link in the template if you have to after the end_control for the menu.
16 July 2007 at 9:02pm
Do do this, create a checkbox field such as OpenInNewWindow on your Page class.
then, edit the menu in the template to have something like
<a href="$Link" <% if OpenInNewWindow %>target="_blank"<% end_if %> >$MenuTitle</a>
See the tutorials for more info.
17 July 2007 at 4:14pm
cheers guys, your help is very much appreciated.
btw: the client has now decided to drop the forum altogether. i'll go and bang my head against a wall for a little while
also: SS rocks, keep up the good work.
|Go to Top|