This project is read-only.

displaying a List Item

Topics: Core, Customizing Orchard
Mar 3, 2013 at 5:32 PM
I thought this may be an easy thing to do but I was unable to find a solution after hours of searching.
I am able to display a projection and changing of the layout was simple to do.
One of the things I do in the projection is to have the title redirect to the list item and display it. This is the screen I would love to make some modifications to. I have a custom-field where I would not like to have the prompt (the text to the left of the value) display. It uses a span with class="name" to display the text-field. I probably could do some CSS stuff to remove the prompt but that seems a bit like "square-peg/Round-hole".
Anyone's help is appreciated.
Mar 3, 2013 at 11:57 PM
Guess what, you were right - it is easy. Override the template for the Title part and do your thing.
Mar 4, 2013 at 1:47 AM
Edited Mar 4, 2013 at 1:49 AM
Sounds easy enough. would that not mean that I would change the code (cshtml)? I am attempting to make the change using the interface. I do not want to change the code everytime I want a change in the layout.
Mar 4, 2013 at 1:56 AM
You can use the rewrite feature of projections. Watch this:
Mar 4, 2013 at 2:51 AM
I would love to use the rewrite feature of a projection. When I "link to original content item", it brings me to a page with the individual item (Article/Testimonial/Video/Product) on it. This item displays in some sort of "default layout".
I do not seem to see this example in this video (then again I am not keeping up with everything in the video). I also see that you have your dashboard set up way different than mine.
Mar 4, 2013 at 3:22 AM
You mean you want to change the layout of the details view, not the layout of the item in the projection results?
Mar 4, 2013 at 3:27 AM
That sounds about right. Sorry about using the wrong vocabulary.
I have a list. I use a projection to show a list. When a user clicks on one of them, the (details) view displays that includes the properties and a default label. On one of the properties, I want to remove the label. It might be also nice to dress the view up a bit.
Thanks for your help.
Mar 4, 2013 at 5:23 AM
Does the details view need to be different if the user came through the projection results?
Mar 4, 2013 at 9:47 AM
Oh wait, so you're not trying to customize the rendering of the title in the list view, but in the details view. As far as I know the only way to do that is by overriding the template in your theme.
Mar 4, 2013 at 10:15 AM
No, the details view will be the same for that particular content type.
Mar 4, 2013 at 10:21 AM
Just to clarify, the Title is fine. It is a Field that I want to customize.
Mar 4, 2013 at 10:24 AM
Ok, but that will yield the same answer: As far as I know the only way to do that is by overriding the template in your theme.
Mar 5, 2013 at 3:28 AM
Thanks for your help.
I can change .\Core\Common\Views\Fields.Common.Text.cshtml, is there a better way to make a change rather than change the "core"? Is there a way to override the template for my content type without losing the base functionality?
Mar 5, 2013 at 4:15 AM
Yes, copy the template into your theme and modify that. Should be /Themes/NameOfYourTheme/Views/Fields.Common.Text.cshtml.
Mar 5, 2013 at 4:20 AM
Thanks Bertrand, wont that change for all text fields? I only want this to affect for a specific content type. It may have been better to create a custom field.
Mar 5, 2013 at 6:17 AM
Yes, like it would if you changed the template in core... If you want to limit the scope, just choose the right alternate.
Mar 7, 2013 at 6:14 AM
I would love to use the rewrite feature of a projection.
Mar 7, 2013 at 9:17 PM
I'm sorry, I don't see a question here.