can't disable title

Topics: Troubleshooting
Mar 20, 2012 at 2:40 PM

Hi,

I can't disable the title of the "Culture Picker Widget" and the title "Styled Menu Widget" i' ve installed advanced menu 1.4.1 module, MultiLanguage 0.2 module.

Even when i deselect the checkbox "Check to to render the title on the front-end, uncheck to hide" and save the title doesn't disappear.

Can anyone help me?

 

thanks

Coordinator
Mar 20, 2012 at 2:44 PM

I had the same issue with Orchard 1.4. It's most likely not related to any of the modules you've enumerated. 

Try to set just empty title.

Mar 20, 2012 at 2:48 PM

I already tried this but when i try to save the settings i get the error message "Title can't be emtpy" :(

Coordinator
Mar 20, 2012 at 2:49 PM

Single space in the title might do the trick ;)

I would suggest you to post this bug to the Orchard project issue tracker.

Mar 20, 2012 at 2:55 PM

nope that doesn't work already tried ;)

i named the widgets as "." thats not a nice solution but i don't have any better.

I' ll post it there.

Apr 23, 2012 at 9:10 PM

I'm having the same problem with the Html Widget in the Header zone.

May 9, 2012 at 1:57 PM
Edited May 9, 2012 at 1:57 PM

Hi Guys

I think I have found the solution (well for my particular case anyway). I'm super new to Orchard so forgive any misuse or misnaming of concepts.

Being very new to Orchard, tracking down the bug was of course the hardest part. To make my life simpler I cloned a copy of the source from CodePlex to my Dev VM and set about tracking it down. After a bajillion breakpoints and no luck, I attempted a very course-grained methodology of code location... use Agent Ransack to search on the source code directory for the CSS class that was being appended to the HTML widget element. In my case the CSS class was "CTitle". Now just to clarify that the only reason why I had this CSS class appended to the element was due to me making use of the custom theme "Dark" from the Orchard gallery (turns out this theme is the real culprit in the whole situation). So after my thorough search throughout the source code I came across the following file where the CSS class was being applied:  \orchard\src\Orchard.Web\Themes\Dark\Views\Widget.Wrapper.cshtml. I then went and compared it to the "base" view from the Orchard.Widgets module (essentially "Dark" theme was overriding this view) found here: \orchard\src\Orchard.Web\Modules\Orchard.Widgets\Views\Widget.Wrapper.cshtml and did quick comparison of the logic.

 

\orchard\src\Orchard.Web\Modules\Orchard.Widgets\Views\Widget.Wrapper.cshtml

 

@using Orchard.ContentManagement;
@using Orchard.Widgets.Models;
@{
    var widgetPart = ((IContent)Model.ContentItem).As<WidgetPart>();
    var tag = Tag(Model, "article");
}
@tag.StartElement
    @if ( (widgetPart.RenderTitle && HasText(widgetPart.Title)) || Model.Header != null) {
    <header>
        @if ((widgetPart.RenderTitle && HasText(widgetPart.Title))) {
        <h1>@widgetPart.Title</h1>
        }
        @Display(Model.Header)
    </header>
    }
    @Display(Model.Child)
    @if(Model.Footer != null) {
    <footer>
        @Display(Model.Footer)
    </footer>
    }
@tag.EndElement

 

\orchard\src\Orchard.Web\Themes\Dark\Views\Widget.Wrapper.cshtml

 

@using Orchard.ContentManagement;
@using Orchard.Widgets.Models;
@{
    var title = ((IContent)Model.ContentItem).As<WidgetPart>().Title;
    var tag = Tag(Model, "article");
}
@tag.StartElement

<div class="">
	<div class="TL">
		<div class="TR">
			<div class="TM">
<span class="CTitle">	
		@if (HasText(title) || Model.Header != null){
			if (HasText(title)) {@title}
			@Display(Model.Header)
		}
</span>
	</div>
		</div>
	</div>
	<div class="ML">
		<div class="MR">
			<div class="MM">	
		@Display(Model.Child)
		@if(Model.Footer != null) {@Display(Model.Footer)}
	</div>
		</div>
	</div>
	<div class="BL">
		<div class="BR">
			<div class="BM"></div>
		</div>
	</div>
</div>
@tag.EndElement

 Check out the green highlighted portions of the code above. In the first code snippet we can see that the full widget part model object is being used. This allows for the method call "RenderTitle" which returns a boolean (the tick box from the widget admin section) and determines if the title should be displayed or not. In the 2nd code snippet you can see the "TitleText" is being used FROM the WidgetPart object, and thus we have no access to the "RenderTitle" method. I simply changed the 2nd code snippet to this:

@using Orchard.ContentManagement;
@using Orchard.Widgets.Models;
@{
    var widgetPart = ((IContent)Model.ContentItem).As<WidgetPart>();
    var tag = Tag(Model, "article");
}
@tag.StartElement

<div class="">
	<div class="TL">
		<div class="TR">
			<div class="TM">
<span class="CTitle">	
		@if ((widgetPart.RenderTitle) && (HasText(widgetPart.Title) || Model.Header != null)){
			if (HasText(widgetPart.Title)) {@widgetPart.Title}
			@Display(Model.Header)
		}
</span>
	</div>
		</div>
	</div>
	<div class="ML">
		<div class="MR">
			<div class="MM">	
		@Display(Model.Child)
		@if(Model.Footer != null) {@Display(Model.Footer)}
	</div>
		</div>
	</div>
	<div class="BL">
		<div class="BR">
			<div class="BM"></div>
		</div>
	</div>
</div>
@tag.EndElement

Anyways I hope you can follow what I have done to resolve the issue. If I figure out how create a change patch, I will attach it here in a later post.