18591 Posts in 4875 Topics by 2285 members
General Questions
SilverStripe Forums » General Questions » Anchor Tags with
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 488 Views |
-
Anchor Tags with

17 August 2011 at 9:04pm
I have tried adding some anchor tags using the editor and cant work out how to do it.. whenever I put them in, it creates a link with a space in there, eg:
<a name="name-of-link"> </a>
Is there a reason for this or a way to stop it?
-
Re: Anchor Tags with

17 August 2011 at 10:20pm
I think this a TinyMCE issue rather then a SilverStripe one. TinyMCE is set to not accept emty tags like that, so it'll add a non-breakable space to it. If you really want it removed you should probably look on the TinyMCE forums...
But on some browsers an empty anchor tag wouldn't even work. Would it be a good idea to move the anchor to a spot where the space doesn't hurt, like at the end of an article title?
-
Re: Anchor Tags with

24 November 2011 at 2:31pm Last edited: 24 November 2011 2:32pm
I have a similar problem where the anchor tags are showing an underlined space.
html produced by tinymce/ss insert link:
<h2><a name="myanchor"> </a>My heading here</h2>
produces:_My heading here
-
Re: Anchor Tags with

25 November 2011 at 12:42am Last edited: 25 November 2011 12:42am
An anchor tag is just another <a>...</a> tag and by default these appear underlined, even for spaces... So apart from getting rid of the added $nbsp; all together, you'll probably have to handle this in css.
Btw: you can disable the automatic addition of the nonbreakable space from an empty anchor. In cms/config.php:
valid_elements' => "@[id|class|style|title],#a[id|rel|...
becomes
valid_elements' => "@[id|class|style|title],a[id|rel|...
But (some?) browsers will now show the text to the right of the anchor as a link, thinking you must have misplaced the anchor's end tag - all this apart from the discussion that there shouldn't be any empty tags in HTML. Replace the with a <!-- anchor --> will not work: /sapphire/javascript/tinyMCE_improvements.js->sapphiremce_cleanup() will strip them out. So again, wherever possible I just put my anchors to the right of the text...
| 488 Views | ||
|
Page:
1
|
Go to Top |


