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

Forums / Designing & Styling / Placeholder titles in a template

Placeholder titles in a template

13 posts, 0 answered
  1. Phil Wilson
    Phil Wilson avatar
    18 posts
    Registered:
    22 Apr 2010
    13 Jul 2011
    Link to this post
    How can we create titles that apear over placeholder regions in a template (similar to what we saw in Sitefinity 3.7)?

    For example, if we have placeholder areas for a Header, Body Content and Footer, how can we create similar labels (sfHeader, sfBody and sfFooter) that are visible in the back end so we know where we are dragging layout elements? Right now, all the placeholder regions all look the same which makes it difficult to put elements in the right place on complex templates.

    Even when using the template editor to create templates from scratch, we still only see headers like 100%, etc. which aren't really helpful.

    I believe the sample layout templates showed these types of custom titles for placeholder regions.

    Also, what happened to the ability from Sitefinit 3.7 where you could use a dropdown list to select which placeholder region to drop a control (widget)? That was actually helpful for placeholder regions which are physically small (such as 50px by 50px).

    Thanks in advance,
    Phil
  2. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    14 Jul 2011
    Link to this post
    Hi Phil Wilson,

    We know about this task - it is logged as PITS item and issue which is scheduled for Q2. You can have however placeholders with different titles and you can use them for example if you create widgets programatically and want them to go to a certain place.

    All the best,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Phil Wilson
    Phil Wilson avatar
    18 posts
    Registered:
    22 Apr 2010
    15 Jul 2011
    Link to this post
    Thanks for the feedback.

    Is there another, more elegant, workaround in the meantime? I'm concerned that our client will be confused about what goes where when we turn the keys of their new site over to them. Right now, there's no indication of what each editable region of the templates are for.
  4. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    15 Jul 2011
    Link to this post
    Hi Phil,

    This appears to be the only way for know. You can create a custom masterpage, and slice it into different placeholders and name them, but still the titles will not be shown. I can suggest to you to use this method and upgrade to a newer version when this feature is included.

    Kind regards,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    20 Mar 2012
    Link to this post
    How many votes are needed to get this from open to in progress?
    http://www.telerik.com/support/pits.aspx#/public/sitefinity/6744
    Markus
  6. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    23 Mar 2012
    Link to this post
    Hi Markus,

    There is no specific number of votes that needs to be achieved - we are taking the top requests and if there are no showstoppers on the way, we are planning and implementing them.

    Regards,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Jochem Bökkers
    Jochem Bökkers avatar
    787 posts
    Registered:
    13 Aug 2007
    24 Mar 2012
    Link to this post
    @Markus (and Phil)

    In the mean time you can play around with Tim's sfPlaceholderLabels script which fixes this...
  8. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    29 Mar 2012
    Link to this post
    Dear Jochem
    Did not get a chance to thank you for it. The community seems to work. However this gives somewhat an open source feeling to SF.
    Thank's again
    Markus
  9. Jochem Bökkers
    Jochem Bökkers avatar
    787 posts
    Registered:
    13 Aug 2007
    29 Mar 2012
    Link to this post
    Hey Markus,

    It is a work around I know, its a good one but I also sometimes don't use it because of the jQuery. There have been other suggestions to make this happen but so far Telerik hasn't found a better/cleaner way than Tim's solution.

    The awesome visual layout editor, where you can drag-n-drop regions on the page, made things a tad more complicated I guess, because it's no longer just <asp:placeholder> that need a name.

    Jochem
  10. Brett Whittington
    Brett Whittington avatar
    89 posts
    Registered:
    10 Aug 2012
    12 Apr 2012
    Link to this post
    Another hack for this if someone did not want to go the jQuery route.  They can add the id of the content placholder into place holder itself using CSS.  The additional content does not show in published page but only in the backend.  Its not as nice as the jQuery but I thought I would show others another option.  This does not work for people using IE7 however.

    I added the following to my masterpage:

    <style>
        div.RadDockZone:after
        {
            content: attr(placeholderid);
        }
    </style>
  11. Arno
    Arno avatar
    249 posts
    Registered:
    08 Sep 2010
    03 Nov 2012
    Link to this post
    Hi all,

    A few work arounds have already been posted here. I'll add mine as well. jQuery and CSS are not required.

    Just include an ASP.NET label before each ContentPlaceHolder in the master page. Then set the Visible property of those labels to false in the page load event in case it is requested in the live environment.

    Master page markup:
    <asp:Label ID="PHHeadMenuLabel" runat="server" Text="Header menu:" Font-Size="1em" Font-Bold="true"></asp:Label>
    <asp:ContentPlaceHolder ID="PHHeadMenu" runat="server"></asp:ContentPlaceHolder>

    Code behind of the master page:
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Telerik.Sitefinity.Web.SiteMapBase.GetCurrentProvider().CurrentNode IsNot Nothing) Then
            Dim CurrentPageGuid As New Guid(Telerik.Sitefinity.Web.SiteMapBase.GetCurrentProvider().CurrentNode.Key)
            Dim CurrentPage As Telerik.Sitefinity.Pages.Model.PageNode = App.WorkWith().Page(CurrentPageGuid).[Get]()
     
            If (CurrentPage.Page.Status = Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live) Then
                PHHeadMenuLabel.Visible = False
            End If
        End If
    End Sub

    See the attached file for what it looks like in the back end when using multiple labels this way. It all seems to work fine in Sitefinity 5.2.
  12. Arno
    Arno avatar
    249 posts
    Registered:
    08 Sep 2010
    08 Nov 2012
    Link to this post
    I just found a better and even simpler solution. It appears that one can just place content within ContentPlaceHolders, a simple <span> for example, like so:

    <asp:ContentPlaceHolder runat="server" ID="PHHeadMenu"><span style="font-size: 1em; font-weight: bold">Header menu:</span></asp:ContentPlaceHolder>

    Unlike the other option I posted, this will also work for pages that have already been published. In runtime it will be replaced by widgets or whatever has been placed in the placeholder. Is even allowed by Microsoft: "You can specify default content placed within the ContentPlaceHolder control tags, but this content is replaced by any content in an associated content page".

    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.contentplaceholder.aspx
  13. Jochem Bökkers
    Jochem Bökkers avatar
    787 posts
    Registered:
    13 Aug 2007
    09 Nov 2012 in reply to Arno
    Link to this post
    @Arno,

    You're right - I use it all the time for a 'drop-only-scripts-here-placeholder' but there's a bug that makes this useless with Normal & Mobile Preview... 

    https://dl.dropbox.com/u/19007909/sitefinity/sfv523700-placeholdercontent-and-actions.mp4

    Plus it breaks page-flow, as in adds obtrusive content when editing a page so when you have small regions to drop something in, it tends to break the design... so I'd say still an issue SF needs to address...
13 posts, 0 answered