Placeholder titles in a template
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
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
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.
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
How many votes are needed to get this from open to in progress?
www.telerik.com/.../pits.aspx
Markus
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
@Markus (and Phil)
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
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.
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
>
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
>
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
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
>
@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...