Copied to clipboard

Flag this post as spam?

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


  • David Challener 80 posts 444 karma points c-trib
    Nov 02, 2015 @ 12:44
    David Challener
    0

    Fetching typed MVC title and description

    Hi,

    This is more likely me not understanding than a bug, but when fetching the title and description using the typed MVC example - how do we handle empty metaData. I understand that these values should be filled in (this works great when they are supplied).

    @{
    var metaData =
    Model.Content.GetPropertyValue<MetaData>("seoChecker");
    }
    <title>@metaData.Title</title>
    <meta name="keywords" content="@metaData.Keywords" />
    <meta name="description" content="@metaData.Description" />
    <link rel="canonical" href="@metaData.CanonicalUrl"/>
    <meta name="robots" content="@metaData.Robots" />
    

    I currently get the empty typed MetaData object back - is there a way to default it to some set values in the configuration section?

    <SEOChecker>
      <focusKeyword></focusKeyword>
      <seoTitle></seoTitle>
      <seoKeywords></seoKeywords>
      <seoDescription></seoDescription>
    </SEOChecker>
    
  • Dipa 88 posts 370 karma points
    Apr 05, 2016 @ 06:39
    Dipa
    0

    Hi David, did you get solution for it?

Please Sign in or register to post replies

Write your reply to:

Draft