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

Forums / Designing & Styling / Custom Widget Layouts for Blog

Custom Widget Layouts for Blog

4 posts, 0 answered
  1. Stacey
    Stacey avatar
    291 posts
    Registered:
    18 Oct 2012
    11 Feb 2011
    Link to this post
    Typically I create the designs and write all the html/css, but I want to gauge how long the process is for me to take something pre-baked and to put it into Sitefinity.   I am currently testing this by taking the Cool Blue theme from StyleShout.com and seeing how much of the proposed blog functionality (based on their design) I can implement.

    The first area I am running into a roadblock is determining if the blog module of Sitefinity offers permalinks and how I would access those.   Another is how I can grab a comment post count to display.  Do I need to write a user control that grabs the comment count and then embed it with the widget layout markup? 

    Below is what I have so far.  You can see the hard coded sections where I want the functionality to go for comments and permalink.  I have not put the timestamp in yet, but I know how to access that.

    <%@ Control Language="C#" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Comments" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Import Namespace="Telerik.Sitefinity" %>   
     
    <telerik:RadListView ID="Repeater" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
        <LayoutTemplate>
            <sf:ContentBrowseAndEditToolbar ID="MainBrowseAndEditToolbar" runat="server" Mode="Add"></sf:ContentBrowseAndEditToolbar>
            <div class="post">
                <asp:PlaceHolder ID="ItemsContainer" runat="server" />
            </div>
        </LayoutTemplate>
        <ItemTemplate>
            <div class="right">
                <h2>
                    <sf:DetailsViewHyperLink TextDataField="Title" ToolTipDataField="Description" runat="server" />
                </h2>
                <p class="post-info">
                    Filed under
                    <sitefinity:FlatTaxonField ID="FlatFieldControl" DisplayMode="Read" runat="server"
                     WebServiceUrl="~/Sitefinity/Services/Taxonomies/FlatTaxon.svc" AllowMultipleSelection="true"
                     TaxonomyId="CB0F3A19-A211-48a7-88EC-77495C0F5374" TaxonomyMetafieldName="Tags" Expanded="false"
                     ExpandText="ClickToAddTags" BindOnServer="true" />
                </p>
                <sf:FieldListView ID="PostContent" runat="server" Text="{0}" Properties="Summary" WrapperTagName="p" WrapperTagCssClass="sfpostSummary" />
                <p><sf:DetailsViewHyperLink ID="FullStory" Text="Read More" runat="server" CssClass="more" /></p>
                <sf:ContentBrowseAndEditToolbar ID="BrowseAndEditToolbar" runat="server" Mode="Edit,Delete,Unpublish"></sf:ContentBrowseAndEditToolbar>
            </div>
            <div class="left">
                <p class="dateinfo">
                    <sf:FieldListView ID="PostDateMonth" runat="server" Format="{PublicationDate.ToLocal():MMM}" />
                    <span><sf:FieldListView ID="PostDateYear" runat="server" Format="{PublicationDate.ToLocal():dd}" /></span></p>
                <div class="post-meta">
                    <h4>Post Info</h4>
                    <ul>
                        <li class="user"><sf:PersonProfileView runat="server" /></li>
                        <li class="time"><a href="#">12:30 PM</a></li>
                        <li class="comment"><a href="#">2 Comments</a></li>
                        <li class="permalink"><a href="#">Permalink</a></li>
                    </ul>
                     
                </div>
            </div>
        </ItemTemplate>
    </telerik:RadListView>
    <sf:Pager id="pager" runat="server"></sf:Pager>
  2. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    11 Feb 2011
    Link to this post
    Try this one for the comments
    <sf:CommentsBox ID="itemCommentsLink" runat="server" CssClass="sfpostCommentsCount"/>

    I don't think we can get to more granular detail on it yet though...
  3. Stacey
    Stacey avatar
    291 posts
    Registered:
    18 Oct 2012
    11 Feb 2011
    Link to this post
    Well that at least gives me something to put in there so that someone can click to go comment.  I see there is a property of CommentsCount on that control so I am wondering if it is possible to set that at some point in code.
  4. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    11 Feb 2011
    Link to this post
    I wondered and put a ticket in for the same thing :)

    This was the response
    <sitefinity:TextField  runat="server"  DisplayMode="Read"  Value='<%# Eval("Comments.Count")%>' />

    Followed with this
    The problem with comments is a bug, I have logged it for fixing (#106714).
4 posts, 0 answered