17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1704 Views |
-
external links

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!
-
Re: external links

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 ...
-
Re: external links

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.. :/
-
Re: external links

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. -
Re: external links

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
[html]
<a href="$Link" <% if OpenInNewWindow %>target="_blank"<% end_if %> >$MenuTitle</a>
[/html]See the tutorials for more info.
-
Re: external links

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.
| 1704 Views | ||
|
Page:
1
|
Go to Top |




