Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tim Gerhard 8 posts 123 karma points
    5 days ago
    Tim Gerhard
    0

    How do I create Anchorlinks in Umbraco

    Umbraco v.7.6.5

    Is there an easy way to create anchor links? I have a client who wants to link anchors of his page inside a rich text editor and I have absolutely no Idea how to achieve that.

    Currently something like this happens: "/page/page-components/Filename-of-Anchor" But I want something like this "/page#Anchorname".

  • Ben Palmer 61 posts 236 karma points
    5 days ago
    Ben Palmer
    0

    Hi Tim,

    I believe TinyMCE does have an anchors plugin but it's disabled by default. Umbraco does however allow you to alter the TinyMCE config: https://our.umbraco.org/documentation/reference/config/tinymceconfig/

    So in the plugins section of the config/tinyMceConfig.config file you may be able to add:

    <plugin loadOnFrontend="false">anchor</plugin>
    

    I haven't tried this so it may or may not be enough. I'll try to give it a go today if I get the chance but hopefully this points you in the right direction at least.

    Just to note that this may only put an anchor into the content (not the link itself) which is potentially what you're looking for. In that case, you'd need to get more creative and potentially make use of the grid system and or nested content - hard to give details without knowing the exact set up you're looking for.

  • Ben Palmer 61 posts 236 karma points
    5 days ago
    Ben Palmer
    0

    Actually, I think I've overthought this. You can enable the Anchor plugin by editing the rich text editor data type. So in Umbraco, you'd go to Developer -> Data Types and click the rich text editor you want to enable it for. Check the box next to Anchor and it should then be enabled.

    This terrible screenshot should point you to the right setting: Anchor setting in Umbraco

  • Tim Gerhard 8 posts 123 karma points
    5 days ago
    Tim Gerhard
    0

    I have lots of anchors already placed on my website. My problem is that i cant find a way to easily link them without accidentally linking the whole page. like described above

  • Ben Palmer 61 posts 236 karma points
    5 days ago
    Ben Palmer
    100

    If it's just setting the link up in the RTE with the standard link picker then you should just be able to put #anchor in as the link (see below image).

    Anchor link in Umbraco

Please Sign in or register to post replies

Write your reply to:

Draft