Forum

The forum is a free service supported by community members. Please consider opening a support ticket if you need timely help.

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 29 Sep 2016 10:48 AM by  Steven McFadyen
Google Structured Data
 5 Replies
Sort:
You are not authorized to post a reply.
Page 1 of 212 > >>
Author Messages


New Member


Posts:22
New Member


--
26 Sep 2016 04:58 PM

    Hi,

    Is there any way to add structured data to topics. I don't mind editing the .aspx directly, but I need some hints on how to proceed (getting the title, published date, etc.).

    A typical markup (not all fields required) example is:

    <script type="application/ld+json">
    { "@context": "http://schema.org",
    "@type": "TechArticle",
    "headline": "Extra! Extra! Read alla bout it",
    "dependencies": "You must be at least a level 2 PRO to make this happen",
    "proficiencyLevel": "Expert",
    "alternativeHeadline": "This article is also about robots and stuff",
    "image": "http://example.com/image.jpg",
    "author": "Patrick Coombe",
    "award": "Best article ever written",
    "editor": "Craig Mount",
    "genre": "search engine optimization",
    "keywords": "seo sales b2b",
    "wordcount": "1120",
    "publisher": "Book Publisher Inc",
    "url": "http://www.example.com",
    "datePublished": "2015-09-20",
    "dateCreated": "2015-09-20",
    "dateModified": "2015-09-20",
    "description": "We love to do stuff to help people and stuff",
    "articleBody": "You can paste your entire post in here, and yes it can get really really long."
    }
    </script>


    Steven

    0


    New Member


    Posts:22
    New Member


    --
    27 Sep 2016 10:52 AM

    This is slightly related. The reason I want the structured data is that the Google data highlighter will not work with the Wiki.

    For example, I enter:

    https://mycableengineerin...e/cable-construction

    and the highlighter returns with:

    https://mycableengineering.com/knowledge-base

    I have another site using SunBlogNuke, and here the Google data highlighter accepts the friendly URL.

    Could there be some issue with the Wiki URL extension provider (or Google itself)? By the way, I appear to have one Wiki URL extension provide installed and 2 StoreFront URL extension providers enabled.

    My thoughts on the structured data were a way around the issues with the Google data highlighter.

    0


    Veteran Member


    Posts:2951
    Veteran Member


    --
    27 Sep 2016 06:34 PM

    I think Google hasn't indexed your page recently, which might explain why the data highlighter can't locate the URL. Here it says "Data Highlighter can only access pages that have been crawled by Google recently".

    You could edit the ViewRevindexWiki.ascx file and use server-side code to pull the information. Once you have the topic object, you can print whatever you need. For example:

    <%@ Import Namespace="Revindex.Business.Revindex.Revindex.Wiki" %>
    <%@ Import Namespace="Revindex.Dnn" %>

    ...
    ...

    <%

    Topic myTopic = null;
    if (String.IsNullOrEmpty(Util.ParseOptimizedQueryValue(Request.QueryString[Global.QueryStringKeys.TopicID])))
    {
    if (!this.IsEditable)
    myTopic = topicController.GetFirstActiveTopicByModule(this.ModuleId);
    }
    else
    {
    myTopic = topicController.GetTopicByModule(int.Parse(Util.ParseOptimizedQueryValue(Request.QueryString[Global.QueryStringKeys.TopicID])), this.ModuleId);

    }

    %>

    ...
    ...
    <%= ContentLocale.GetValue(myTopic.Name) %><br/>
    <%= ContentLocale.GetValue(myTopic.TopicContent) %><br/>
    <%= ContentLocale.GetValue(myTopic.PageTitle) %><br/>
    <%= myTopic.CreateDate.ToString() %><br/>

    0


    New Member


    Posts:22
    New Member


    --
    28 Sep 2016 10:39 AM

    Stephen,

    This is great.

    I nearly have everything work (can get the CreateDate). I am struggling with the Name and Page title as when I try 'ContentLocale' I get the message that it does not exist in the current context. Do you have any suggestions?

    Regards,

    Steven

    0


    Veteran Member


    Posts:2951
    Veteran Member


    --
    28 Sep 2016 05:25 PM

    I think you need to import the namespace:

    <%@ Import Namespace="Revindex.Data.Dnn" %>

    0
    You are not authorized to post a reply.
    Page 1 of 212 > >>