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

Forums / Developing with Sitefinity / Display Blog Post Using Custom Control Widget

Display Blog Post Using Custom Control Widget

2 posts, 0 answered
  1. Nigel
    Nigel avatar
    4 posts
    Registered:
    17 Apr 2013
    17 Apr 2013
    Link to this post
    Firstly I am a NOOB using Sitefinity.

    For the site I am working on we want to develop our own layout for blog posts using a Custom Control Widget.

    So far I have:

    1. Created a template which points to a master page. The master page has one contentplaceholder on it.
    2. Created a page which uses the above template and I can drag my custom control onto the page within the widget area.

    However when I publish the page and try to browse a blog post I simply get a blank page.

    The intersting thing that is if I drag the Blog Posts widget onto the page as well I then get the post listed twice - once from the Blog Posts widget, and once from my custom control.

    The initial part of my code behind file is below:

    string url = Request.RawUrl.ToString();

                int lastSlash = url.LastIndexOf("/");

                if (url.LastIndexOf("/") > 0)
                    url = url.Substring(url.LastIndexOf("/") + 1);

                Post post = svc.GetPost(url); //custom method to return post data ...

    Is anyone able to enlighten as to what I need to do to get my page working ?

    Thanks, Nigel
  2. Nigel
    Nigel avatar
    4 posts
    Registered:
    17 Apr 2013
    17 Apr 2013 in reply to Nigel
    Link to this post
    OK - as is often the case a bit more perserverance has somewhat progressed my issue.

    I have now removed my custom control from the page and using Using external widget template file as a reference I have managed to get a page displaying albiet without any blog post information being displayed from the user control.

    So my question now is what is the best way to develop a custom layout ? One key consideration is that we have some custom functionality that extracts all images from the blog post content and displays in a separate column on the page. There is also functionality to modify the content to remove the images and just leave the content.

    Thanks, Nigel
2 posts, 0 answered