+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How/Where Can You Control the Markup that the Blog Module Outputs?

How/Where Can You Control the Markup that the Blog Module Outputs?

7 posts, 1 answered
  1. Russell
    Russell avatar
    25 posts
    Registered:
    08 Apr 2009
    03 Nov 2010
    Link to this post
    For example, let's say that when I post an entry, I want the post title to be a Heading Level 3 element, instead of a Heading Level 1.  Basically, where is the markup coming from (which file controls this)?

    Any help is greatly appreciated.  I'm new to Sitefinity so I admit this may be an extremely obvious question.  Thanks!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 Nov 2010
    Link to this post
    Hi Brad,

    The post does not have a title

    The structure is

    1. Forum - status, title of the forum, posts, therads, last post

    2.Thread - status, title, created date, posts, last post

    3. SingleThread with posts

    - thread title
    - posted by

    4. Post Reply

    - Quote -all posts in the current thread
    - content

    Could you attach a screenshot or clarify which part you want to modify, so I could point you to the right direction.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Russell
    Russell avatar
    25 posts
    Registered:
    08 Apr 2009
    03 Nov 2010
    Link to this post
    Hi Ivan,

    I wish to Modify the HTML that is output on a Blog page.  I dragged the Blog control into a page.  I've included two screenshots.  In the 2nd screenshot, the link that says "First Post" is the name of the post and I was curious where I can control how that is output into the HTML.  Right now it's being generated as a H2 element.

    Thanks,
    Brad
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 Nov 2010
    Link to this post
    Hi Brad,

    Please take a look at this KB - how to appy custom stylesheets to content view controls

    The Title of the post is a Literal wrapped inside a HyperLink control

      <h2 class="sf_postTitle">
                <asp:HyperLink ID="fullContent1" runat="server">
                <asp:Literal ID="Title" runat="server"></asp:Literal>
            </asp:HyperLink>
    </h2>

    If you want you can also modify the external template - ListPageMaster.ascx (How to map a template)

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  5. Russell
    Russell avatar
    25 posts
    Registered:
    08 Apr 2009
    04 Nov 2010
    Link to this post
    Hi Ivan,

    I followed the article on how to map to an external template.  I downloaded the External Template files for my version of .net.  I then added the following code to the Configuration.Controls.Config.xml file:

    <viewSettings hostType="Telerik.Blogs.WebControls.BlogPosts">
          <additionalTemplates>
            <!--Provides user interface for displaying a list of posts in the BlogPosts control in the blogs module.-->
            <add key="ItemListTemplate" layoutTemplatePath="~/Sitefinity/ControlTemplates/Blogs/ContentViewItemList.ascx" />
            <!--Provides user interface for displaying a single post in the BlogPosts control in the blogs module.-->
            <add key="SingleItemTemplate" layoutTemplatePath="~/Sitefinity/ControlTemplates/Blogs/ContentViewSingleItem.ascx" />
          </additionalTemplates>
        </viewSettings>

    I placed these files in the correct folder locations but they still aren't overriding the default templates. I made sure to also include the External Resource files in their correct location as well. I tried to follow the knowledge base article, but perhaps I missed something obvious?  Thanks!
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    04 Nov 2010
    Link to this post
    Hello Brad,

    Could you try to set the templates through SingleItemTemplatePath and ItemListTemplatePath properties or inside the ControlDesigner as this post shows working with presentation modes

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Russell
    Russell avatar
    25 posts
    Registered:
    08 Apr 2009
    04 Nov 2010
    Link to this post
    Hi Ivan,

    It's working!  I found the problem - I followed the KB article a little too closely and was placing the Resource file (App_LocalResources) in the Admin folder instead of the same directory as the actual template file.

    Thanks for all of your help,
    Brad
Register for webinar
7 posts, 1 answered