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

Forums / Designing with Sitefinity / Is this the best way to use Sitefinity?

Is this the best way to use Sitefinity?

3 posts, 0 answered
  1. Harry
    Harry avatar
    23 posts
    Registered:
    07 Aug 2008
    10 Oct 2009
    Link to this post
    I've created a page that looks like the attached file untitled-1.jpg. It was made mainly with CSS using the HTML mode of the generic content editor (see attached file untitled-2.jpg).

    It seems that it would be kind of a pain for a non-HTML/CSS person to edit. Should I be doing this a different way to take advantage of Sitefinity? for instance, should the tabs be a rad rabstrip? but that makes the content separate pages (or not?)? The images for this page were all uploaded into the Images/Products folder that I created off the root. Is there a better place to put the images? Content on the support tab will be the same across all products - is there a way to write it once and then drop it into that tab (which wouldn't work with the current CSS tabs I think)?

    Thanks in advance for your thoughts. I'm new to Sitefinity, but it seems to have a huge feature set. I just want to make sure I'm setting things up correctly.



  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    11 Oct 2009
    Link to this post
    Hi nikolaus,

    I think that you could create a custom control that inherits from SimpleControl class. Then override LayoutTemplatePath property and return the path to a custom template that you should create - it can be the same html as you have in GenericConent control.
    For the images you can create a two public properties - This will allow you to change the images easily. For instace you could upload your image to Images and Documents directory and benefit from dynamic links - this will ensure that after changing the name of the image its url will will not be broken. For the text under your divs section you could add Literal or other ITexControl and again create public properties. By doing so your users will use Properties interface instead of typing in the HTML dialog of the RadEditor.

    sample code:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Telerik.Cms.Web.UI;
    using System.Web.UI.WebControls;
     
    /// <summary>
    /// Summary description for testDelete
    /// </summary>
    public class TelerikSampe: SimpleControl
    {
        public TelerikSampe()
        {
        }
     
        public string Literal1
        {
                get
                {
                    object o = this.ViewState["Literal1"];
                    if (o == null)
                        return "It Works";
                    return (string)o;
                }
                set
                {
                    this.ViewState["Literal1"] = value;
                }
        }
     
        public override string LayoutTemplatePath
        {
            get
            {
                return "~/CustomControls/TelerikSampe.ascx";
            }
        }
     
        protected override void  InitializeControls(System.Web.UI.Control controlContainer)
        {
          base.InitializeControls(controlContainer);
          label.Text = Literal1;
        }
     
     
        public Label label
         {
            get
            {
                return this.Container.GetControl<Label>("Label1", false);
            }
         }
    }

    template

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="TelerikSampleTemplate.ascx.cs" Inherits="CustomControls_TelerikSampleTemplate" %>
     
    <div class="test" id="textTest"><asp:Label ID="Label1" runat="server"></asp:Label></div>

    I hope this helps.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Harry
    Harry avatar
    23 posts
    Registered:
    07 Aug 2008
    11 Oct 2009
    Link to this post
    Thanks, Ivan. I'll dig into this and give it a shot!
Register for webinar
3 posts, 0 answered