Copied to clipboard

Flag this post as spam?

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


  • René 327 posts 852 karma points
    May 16, 2014 @ 11:43
    René
    0

    Seo Visualizer - Insert title & Meta description

    Hi 

    Nice little pacakage http://our.umbraco.org/projects/collaboration/seo-visualizer

    One question when i insert into the template i get this:

    { "title": "Title of the site", "description": "Description of the site- Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore Lorem ipsum dolor sit." }

    Any hint, or easy way to use it in the template.

    I suppose i should use AngularJs  https://angularjs.org/, is this the way it was intended to be used

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 16, 2014 @ 14:56
    Jan Skovgaard
    0

    Hi René

    Do you mind sharing the code you're using for getting the values currently?

    You don't need angular to fetch the values - property editors and the backoffice UI is based on Angular but you need to fetch the values in your templates using XSLT or Razor.

    /Jan

  • René 327 posts 852 karma points
    May 16, 2014 @ 16:45
    René
    0

    Do not at all.. 

    Another problem, i cant log in to Umbraco, i lft the computer when i was logged in, and session timed out. 

    I vill try to solve this first

    1. Remote Address:
      127.0.0.1:80
    2. Request URL:
    3. Request Method:
      POST
    4. Status Code:
       
      400 Bad Request
    5. Request Headersview source
      1. Accept:
        application/json, text/plain, */*
      2. Accept-Encoding:
        gzip,deflate,sdch
      3. Accept-Language:
        en-US,en;q=0.8,da;q=0.6,nb;q=0.4
      4. Connection:
        keep-alive
      5. Content-Length:
        47
      6. Content-Type:
        application/json;charset=UTF-8
      7. Host:
        amjaumbraco7.local
      8. Origin:
      9. Referer:
      10. User-Agent:
        Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36
    6. Request Payloadview source
       
      {username:[email protected], password:xxxxx}
      1. password"xxxxx"
      2. username"[email protected]"
    7. Response Headersview source
      1. Cache-Control:
        no-cache
      2. Content-Length:
        0
      3. Date:
        Fri, 16 May 2014 14:42:10 GMT
      4. Expires:
        -1
      5. Pragma:
        no-cache
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 16, 2014 @ 23:16
    Jan Skovgaard
    0

    Hi René

    What version of Umbraco 7 are you currently using?

    /Jan

  • René 327 posts 852 karma points
    May 17, 2014 @ 09:36
    René
    0

    Hi

    I use version 7.1.2

    I can see there are a new version, i vill try this.

    Rene

     

  • Bjarne Fyrstenborg 1281 posts 3992 karma points MVP 8x c-trib
    Aug 14, 2014 @ 11:56
    Bjarne Fyrstenborg
    0

    Hi René

    Did you solve your issue?

    Seo Visualizer returns json and to get the title or description values in your MVC razor views, you can write e.g. this with the dynamic object:

    var pageTitle = string.IsNullOrWhiteSpace(CurrentPage.Title)
            ? CurrentPage.Name
            : CurrentPage.Title;
    
        var seoTitle = "";
        if (CurrentPage.HasValue("metaData") && CurrentPage.MetaData.title != null && !string.IsNullOrWhiteSpace(CurrentPage.MetaData.title.ToString()))
        {
            seoTitle = CurrentPage.MetaData.title;
        }
        else
        {
            seoTitle = pageTitle;
        } 

     

    <meta name="description" content="@CurrentPage.MetaData.description" />
    <title>@seoTitle</title>

    you can also write a Property Editor Value Converter which return an object with properties for title and description, so you can use strongly typed object.

    /Bjarne

  • Markus Johansson 1930 posts 5858 karma points MVP 2x c-trib
    Aug 15, 2014 @ 13:01
    Markus Johansson
    0

    Hi!

    I just coded this thing in 20 minutes to do a presentation at a Swedish Umbraco meetup. A Property Editor Value Contevert would be the "right" way to do this. But what I did was to convert the json-string into an object that looked something like this:

    public class SeoFields
    {
    public string title {get;set;}
    public string description {get;set;}


    I did that convertion in the view which is not best practice. If you would like to update the package with a property editor value convert just make a poll request to the github-repo - otherwise I may do that when I find some time for it =D

    Cheers! 

  • Bjarne Fyrstenborg 1281 posts 3992 karma points MVP 8x c-trib
    Aug 15, 2014 @ 13:31
    Bjarne Fyrstenborg
    0

    Hi Markus

    Yes, I would make it easier to use with strongly typed object.. I think Tims example here http://www.nibble.be/?p=337 is almost what is needed to know.. just with your class instead with the properties Title and Description.

    /Bjarne

  • Markus Johansson 1930 posts 5858 karma points MVP 2x c-trib
    Aug 15, 2014 @ 14:41
    Markus Johansson
    2

    My code fingers could not keep away from this =D So I've added a property value converter now =D

    http://our.umbraco.org/projects/collaboration/seo-visualizer

    Read more about usage here: https://github.com/enkelmedia/Umbraco7-SeoVisualizer

    Cheers! 

  • Bjarne Fyrstenborg 1281 posts 3992 karma points MVP 8x c-trib
    Aug 15, 2014 @ 14:54
    Bjarne Fyrstenborg
    0

    Awesome! .. great work Markus :) #h5yr

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Aug 15, 2014 @ 18:37
    Jeavon Leopold
    0

    Great work Marcus! Just left you a little suggestion on your value converter commit in GitHub.

Please Sign in or register to post replies

Write your reply to:

Draft