SfPlaceholder in tag ?
I want a widget to able to select a style sheet from a Document & Files Library. But if if I use
@Html.SfPlaceHolder("CSSPlaceHolder") with the <head> and </head> element of the template it does
not show while editing the page.
Are there any alternatives to getting something in the head element ?
You can easily add new styles in page head with this code inside your controller:
var page =
this
.GetHttpContext().CurrentHandler.GetPageHandler();
page.Header.Controls.Add(
new
LiteralControl(something));
If you still have problem, you can check source code of built-in stylesheet widget in sitefinity https://github.com/Sitefinity/feather-widgets/blob/master/Telerik.Sitefinity.Frontend.InlineClientAssets/Mvc/Controllers/StyleSheetController.cs
The placeholders defined with @HTML.SfPlaceHolder are intended for dragging widgets from the UI.
If you want to register assets at specific places you need sections and the @Html.Stylesheet helper method. Please refer to the corresponding doc article for more details.
Thanks Victor
Thanks for the help