How do i insert pure html into a zone?

Topics: Customizing Orchard, General, Writing themes
Nov 25, 2011 at 12:17 AM

Hi all,

I created a new theme, installed it and everything workd fine. Now i have a logo for my website and i would like to give my client the option to

change the default logo. I created a new zone called it logo. And i chose HtmlWidget in order to insert the image to this logo zone. but..

When i check the html code, i see i don't get pure html insterted into the zone but something like that:

<div class="zone zone-logo"><a href="/">
    </a><div class="widget-control"><a href="/">
        </a><div class="manage-actions"><a href="/"></a><a href="/OrchardLocal/Admin/Widgets/EditWidget/37?ReturnUrl=%2FOrchardLocal%2F">Edit</a></div>
<p shape-id="5" class=""><img width="189" height="54" alt="" src="/OrchardLocal/Media/Default/HtmlWidget/new_logo.png" shape-id="5" class=""></p>
    </div>
</div>

The result i need is something like that:

<img width="189" height="54" alt="" src="/OrchardLocal/Media/Default/HtmlWidget/new_logo.png" shape-id="5" class="">

How do i do it ?


 

Nov 25, 2011 at 12:38 AM

The "Edit" link is only there while you or the client are logged in.

Nov 25, 2011 at 12:40 AM

The Edit link maybe.. but the other div and the p tags stay also when no one the logged in..

Nov 25, 2011 at 12:45 AM

The p tag is probably inserted automatically by TinyMCE when you are adding the image (you can verify this by clicking the Source button in the TinyMCE editor).

By "the other div" do you mean <div class="zone zone-logo">? All zones will automatically add this. It's technically possible to remove it but why bother, it allows you greater styling control.

Nov 25, 2011 at 12:50 AM

Yep, the p tag is inserted by tinyMCE you are right...

Actually the other div is giving me design troubles..Would you please guide me how to remove this <div class="zone zone-logo">?

Nov 25, 2011 at 1:12 AM

I need to remove these two divs:

<div class="zone zone-logo">
<div class="widget-control">

They both appear when you are not logged in.. 
Nov 25, 2011 at 1:21 AM

"widget-control" does not appear when you're logged out; please double check, and post here the code that you actually get. If it's displaying then something is very wrong.

As for the "design troubles", exactly what are you not able to solve with CSS, when you can very precisely target .zone-logo?