Find template

Topics: Customizing Orchard
Oct 28, 2011 at 3:55 PM

Hi,

I want find template where is insert this  

"Content_ControlWrapper"

Below code is inside  
public class Shapes 

 

 if ( !displaying.ShapeMetadata.DisplayType.Contains("Admin") )
                            displaying.ShapeMetadata.Wrappers.Add("Content_ControlWrapper");

"Content_ControlWrapper" this is cshtml file . using above code its display content intemplate. I want find that root template. How can i find it

krds
lakmal

Coordinator
Oct 28, 2011 at 6:37 PM
Edited Oct 28, 2011 at 6:37 PM

Content.ControlWrapper.cshtml. It's in core/views

Shape tracing would have told you that by the way. http://orchardproject.net/docs/Customizing-Orchard-using-Designer-Helper-Tools.ashx

Oct 28, 2011 at 6:50 PM

I want find which template use to display "Content.ControlWrapper.cshtml"

When i trace shape. something like this

 

<li> code of Content.ControlWrapper.cshtml </li>

I want apply custom css class to this <li> tag

 

Which control or wich template belong to this <li> tag

 

lakmal

Coordinator
Oct 28, 2011 at 7:17 PM

Use the dev tools of your browser to determine a good CSS selector to target that element, then add a rule to your theme's stylesheet. If you can't do that, override the template in your theme and modify the markup by adding a class to the tag. It will then be very easy to add a rule in your css.

Nov 3, 2011 at 4:30 PM

Hi,

 

I have solve issue. I have edit this

src\Orchard.Web\Core\Contents\Views

@using Orchard.ContentManagement;
@using Orchard.Core.Contents;
@if (AuthorizedFor(Permissions.EditContent) && Model.ContentItem.Id > 0) {
    
       @Html.ItemEditLinkWithReturnUrl(T("Edit").Text, (ContentItem)Model.ContentItem)
    @Display(Model.Child)
   
}
else {
    @Display(Model.Child)
}

Coordinator
Nov 3, 2011 at 7:35 PM

You shouldn't edit anything in core. You should be able to override that view in your theme instead.

Nov 3, 2011 at 7:41 PM
bertrandleroy wrote:

You shouldn't edit anything in core. You should be able to override that view in your theme instead.

And Shape Tracing can do that for you too. Look under alternates, you'll find create buttons. VERY HANDY

Nov 4, 2011 at 4:20 AM

How can i override from theme. Is there any sample code available?

 

Coordinator
Nov 4, 2011 at 6:07 AM

reverand just told you: use shape tracing. what it does is just copy the file into your theme.