No way to change the separator for the forum widget breadcrumb?
I tried searching, but only came up with those wanting to modify the regular breadcrumb widget. I'm referring to the ForumsBreadcrumb widget as part of the forum template (<sfForums:ForumsBreadcrumb />), but I see no way of doing so.
It pulls the separator from a control inside the default template. Here is the default template and accessor code:
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<
div
class
=
"sfforumPostBreabcrumbWrp"
>
<
asp:PlaceHolder
ID
=
"pagePathHolder"
runat
=
"server"
>
<
asp:Repeater
ID
=
"pagePath"
runat
=
"server"
>
<
ItemTemplate
>
<
sf:SitefinityHyperLink
runat
=
"server"
Text='<%# Eval("Title") %>' NavigateUrl='<%# Eval("Url") %>'></
sf:SitefinityHyperLink
>
</
ItemTemplate
>
<
SeparatorTemplate
>
<
asp:Literal
runat
=
"server"
> / </
asp:Literal
>
</
SeparatorTemplate
>
</
asp:Repeater
>
<
asp:Literal
ID
=
"pagePathSeparator"
runat
=
"server"
> / </
asp:Literal
>
</
asp:PlaceHolder
>
<
sf:SitefinityHyperLink
ID
=
"start"
runat
=
"server"
Text="<%$Resources: ForumsResources, ForumsTitle %>"></
sf:SitefinityHyperLink
>
<
asp:Literal
ID
=
"groupSeparator"
runat
=
"server"
> / </
asp:Literal
>
<
sf:SitefinityHyperLink
ID
=
"group"
runat
=
"server"
></
sf:SitefinityHyperLink
>
<
asp:Literal
ID
=
"forumSeparator"
runat
=
"server"
> / </
asp:Literal
>
<
sf:SitefinityHyperLink
ID
=
"forum"
runat
=
"server"
></
sf:SitefinityHyperLink
>
<
asp:Literal
ID
=
"threadSeparator"
runat
=
"server"
> / </
asp:Literal
>
<
sf:SitefinityLabel
ID
=
"thread"
runat
=
"server"
></
sf:SitefinityLabel
>
</
div
>
Accessor:
private ITextControl ThreadSeparator
get
return this.Container.GetControl<
ITextControl
>("threadSeparator", true);
It does this for each separator. I cannot set the separator strings because their accessor properties are marked as private. So, my intention was to use my own modified version of ForumsBreadcrumb.ascx and set these values.
However, I cannot change the LayoutTemplateName property of the control from within the template, since the LayoutTemplateProperty property is GET only.
protected override string LayoutTemplateName
get
return null;
ALSO, I cannot OVERRIDE the ForumsBreadcrumb control to then override the LayoutTemplateName property, because the class itself is marked as sealed.
So, how in the hell do you change the default separator of '/' to be something else? Thanks.
Hello Ryan,
You are correct - there is no way to change the breadcrumb separator slash from the template or its codebehind. I am posting the reply for your support ticket for the rest to view:
"I am afraid you do not have the ability to change the breadcrumb separator from our default template. The good thing is that you are able to manipulate the character with JQuery so it can be replaced with one of your choosing. I can recommend the ReplaceAll method. You can apply it to the sfforumPostBreabcrumbWrp id or the forum breadcrumb control."
Regards,
Ivan D. Dimitrov
Telerik
Thanks for the reply.
Let this be a lesson to the Sitefinity developers as to when NOT to seal a class. Ugh.
Maybe a future version will allow this? At least remove the "sealed" keyword on the class. Or, allow us to use a different template for that specific breadcrumb control.
There's no way I'm using a JavaScript hack.
Thanks.
Hello Ryan,
I believe this request is viable - widget extending is a fairly frequent client request and having widgets with internal methods and properties hinders the process. Please feel free to add this as a future request in our Portal. We will have it in mind and do our best to include it in our future releases.
Regards,
Ivan D. Dimitrov
Telerik
Hi guys,
Ryan has logged a feature request for this particular behavior. Feel free to vote and track its progress here.
Regards,
Ivan D. Dimitrov
Telerik