Differentiating Field views in different displaytypes?

Topics: General, Writing themes
Mar 19, 2012 at 1:17 AM

Hey guys, I have some views overriding some fields as in:

Fields.Common.Text-User-Info.cshtml
The content within that file renders my ‘summary’ display view [as it’s altering all such fields for that User type] the way I want, but how would I go about altering the same field within a ‘detail’ display, mainly, how do I name such a file to be specific for such a situation e.g.’s:

Fields.Common.Text-User-Info.Detail.cshtml [doesnt work]

Content-User.Info.Detail.cshtml [doesnt work either]
Is it possible to differentiate? Thanks for your time, pg

Mar 20, 2012 at 1:26 AM

Hey guys, ended up manually designating an Alternate Template:

how to found here:

http://docs.orchardproject.net/Documentation/Alternates

Cheers

Mar 20, 2012 at 1:53 AM

Hmm, here we go again...replied prematurely, yes my alterante via tracing is referenced as templated used, I can see my code in the template view - but it certainly doesnt use it.  As in, I can have a template referenced with no code whatsoever and it still displays from the original template, even though it says its using my manually overriden one? i.e.

TRACE:

Shape Fields_Contrib_Image

Active Template ~/Themes/ORC/Views/Fields.Contrib.Project-IntroPic.Summary.cshtml  [which is correct, and what I want - but clearly doesnt display it]

Original Template Template ~/Modules/Contrib.ImageField/Views/Fields/Contrib.Image.cshtml  [I believe it's still rendering this one]

Ahy thoughts, BUG? Cheers pg

Mar 20, 2012 at 2:12 AM

Ok, clearly it doesnt like that filename [...I wanted it somewhat uniform to the orchard schema to make locating/editing easier], but therefore, it must interfere with the inner workings. For if i change the filename to 'Fields_Contrib_Project_IntroPic_Summary', it works fine. Cheers pg