Placeholder titles in a template

Posted by Community Admin on 05-Aug-2018 02:18

Placeholder titles in a template

All Replies

Posted by Community Admin on 13-Jul-2011 00:00

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

Posted by Community Admin on 14-Jul-2011 00:00

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

Posted by Community Admin on 15-Jul-2011 00:00

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.

Posted by Community Admin on 15-Jul-2011 00:00

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

Posted by Community Admin on 20-Mar-2012 00:00

How many votes are needed to get this from open to in progress?
www.telerik.com/.../pits.aspx
Markus

Posted by Community Admin on 23-Mar-2012 00:00

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

Posted by Community Admin on 24-Mar-2012 00:00

@Markus (and Phil)

In the mean time you can play around with Tim's sfPlaceholderLabels script which fixes this...

Posted by Community Admin on 29-Mar-2012 00:00

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

Posted by Community Admin on 29-Mar-2012 00:00

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

Posted by Community Admin on 12-Apr-2012 00:00

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>

Posted by Community Admin on 03-Nov-2012 00:00

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.

Posted by Community Admin on 08-Nov-2012 00:00

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".

msdn.microsoft.com/.../system.web.ui.webcontrols.contentplaceholder.aspx

Posted by Community Admin on 09-Nov-2012 00:00

@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... 

dl.dropbox.com/.../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...

This thread is closed