Copied to clipboard

Flag this post as spam?

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


  • David Peck 687 posts 1863 karma points c-trib
    Nov 16, 2018 @ 16:51
    David Peck
    0

    Individual access to Social fields

    I have some custom routing, as per: https://our.umbraco.com/documentation/reference/routing/custom-routes

    IPublishedContentWrapped is used to mix a genuine IPublishedContent item with external data.

    When I output the social tags (using .SocialTags) the canoncial url renders the url of the genuine IPublishedContent item instead of the url that was request in my custom route. I don't want this, as this url will not return anything.

    I don't necessarily expect to be able to setup SEOChecker to pull through my custom url automatically, but it would be good to be able to access all the data that .SocialTags uses to provide my own implementation of the tags rendered.

    How can I access things like the Twitter user name, and the FacebookTitle, from the view?

    Cheers,

    David

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Nov 19, 2018 @ 08:14
    Richard Soeteman
    0

    Hi David,

    Thought this was in the documentation, but was not, sorry about that.

    You can use

    @{
        var meta = Model.Content.GetPropertyValue<SEOChecker.MVC.MetaData>("seoChecker");
    }
    @meta.SocialTags
    

    To render all social tags.

    Hope this helps,

    Richard

  • David Peck 687 posts 1863 karma points c-trib
    Nov 19, 2018 @ 16:52
    David Peck
    0

    Hi Richard,

    That is in the docs I've seen. The problem is that the og:url is wrong for my custom routes. For now I've stripped it out through .IndexOf() but that feels a bit hacky. Is there no other way to access the social data in the view?

    Cheers,

    David

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Nov 20, 2018 @ 07:08
    Richard Soeteman
    0

    Hi David,

    Underneath it is using SEOChecker.Library.Metadata which has access to all the properties.

    Hope this helps,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft