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

Forums / Designing with Sitefinity / Skinning a News Section

Skinning a News Section

10 posts, 0 answered
  1. Troy Lawrence
    Troy Lawrence avatar
    56 posts
    Registered:
    07 Jan 2010
    11 Feb 2010
    Link to this post
    I'm attempting to skin a news section on my site, but I'm not getting the right results.  I starting thinking that I've seen this type of layout on Blogs.  My goal is to skin the section so the month and the day are populated inside of a cool calendar icon.  This is very popular in blogs.   I'm wondering if this is possible in Sitefinity?  And, if so, would it be best for me to try to achieve this effect using a Sitefinity blog or News module?   See my attached file for what I'm going for in my final output.

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    11 Feb 2010
    Link to this post
    Hi Troy Lawrence,

    Thank you for using our services.

    This is possible. However you will need to edit the control templates for your News View. Then you will see that the date is populated in a server side literal control. You can wrap the date controls in divs and provide styles for those divs. For more information check this KB article: How to apply custom style sheets to Sitefinity Content View controls

    Kind regards,
    Radoslav Georgiev
    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. Troy Lawrence
    Troy Lawrence avatar
    56 posts
    Registered:
    07 Jan 2010
    18 Feb 2010
    Link to this post
    I'm still not having any luck with achieving the proper look on our news section.  You mentioned "the date is populated in a server side literal control."

    I'm not sure what that means?  Is it possible to style the month on one line and the day on the other?

    The only files I've been editing have been:

    News/ListPageMaster.ascx

    News/ListPageDetail.ascx



  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    18 Feb 2010
    Link to this post
    Hello Troy Lawrence,

    This is what I mean by serverside literal control:

    <asp:Literal ID="Publication_Date" runat="server" Text="{0}" />

    What you have to do is to add two more literals, one for month and one for day. Then on page load you will get the value from Publication_Date.Text and parse it into two substrings (probably using string.Split) and assing each substring for month and date respectively. Then set the visible property of the original date control to false.

    All the best,
    Radoslav Georgiev
    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.
  5. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    22 Feb 2010
    Link to this post
    I would suggest grabbing the date as a DateTime instead of split string, that way you can retrieve whatever elements of the date as needed (day of week, day of month, month name, etc). of course this assumes you have the date in parseable format

    something like:

    var d = DateTime.Parse(PublicationDate.Text);
    Month.Text = d.ToString("MMM");
    Day.Text = d.ToString("d")

    where Month and Day are Literal controls on the ascx file.

    I would further suggest that instead of using the month, you save each month as an image, then use the month name as a css class for a Panel containing the date

    Panel.CssClass = d.ToString("MMMM");
    Day.Text = d.ToString("d");

    that way the cssclass can load the appropiate background image for that month

    I hope that makes sense. I did this exact thing for my blog (http://www.selarom.net/blog) so if you have further questions let me know I'll do what I can to help!
  6. dkorber
    dkorber avatar
    3 posts
    Registered:
    27 Apr 2007
    08 Apr 2010
    Link to this post
    Does the solution presented in http://www.sitefinity.com/support/kb/sitefinity-3-x/how-to-apply-custom-style-sheets-to-sitefinity-content-view-controls.aspx also apply to Community Edition I am asking because I didn't find the .ascx files....
  7. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    08 Apr 2010
    Link to this post
    yes mapping templates should work the same in the community edition. The ascx files are available as the "ExternalTemplates", a separate download in your account (beneath the main download for sitefinity)
  8. dkorber
    dkorber avatar
    3 posts
    Registered:
    27 Apr 2007
    14 Apr 2010
    Link to this post
    didn´t worked for me.

    Look at my code (VB):
    1.Sub PageLoad() Handles Me.Load
    2.  Dim p As Literal = Me.FindControl("Publication_Date")
    3.  Dim d As Literal = Me.FindControl("litDay")
    4.  d.Text = p.Text
    5.End Sub

    The result is "Object reference not set to an instance of an object." It doesn´t find the Publication_Date control....


  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    14 Apr 2010
    Link to this post
    Hi dkorber,

    You need to get the Literal from the Repeater item template, not from the page directly.

    Best wishes,
    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.
  10. dkorber
    dkorber avatar
    3 posts
    Registered:
    27 Apr 2007
    14 Apr 2010
    Link to this post
    Thanks for the answer, Ivan, but the problem still occurs....

    1.Sub PageLoad() Handles Me.Load
    2.  Dim p As Literal = Me.repeater.FindControl("Publication_Date")
    3.  Dim d As Literal = Me.repeater.FindControl("litDay")
    4.  d.Text = p.Text
    5.End Sub

Register for webinar
10 posts, 0 answered