Use List module or a Widget based on Projection

Topics: Customizing Orchard
Feb 27, 2014 at 7:00 AM
I'm trying to customize a List Shape, that is generated after assigning a Projection to a Widget.

But, I can't do it well.

I read this article, but I have the doubt in the subject.
http://docs.orchardproject.net/Documentation/Creating-lists

Thanks
Feb 27, 2014 at 7:00 PM
The article is outdated. It refers to an special module "Lists", that is not recommended anymore (btw it is under a complete rewriting that will be released soon with version 1.8 , maybe in a couple of weeks).

The list module has nothing to do with projections. You can customize how your list is displayed in the query, by adding a layout. There are predefined options to customize the layout for the query without coding. And if you want to take full control of the rendering process you can use your own template to override the default by using alternates.
Can you elaborate a little more about what do you want to do?
Feb 27, 2014 at 9:28 PM
Hi,
I created a new content item, called "Unique Selling Proposition Item", is formed by three content parts: Media Piker Part, Title Part and Body Part.

I pushed 3 items using admin editor.

Then I created a Query for the content type, and limited it to 3 items.

I created Widget_Named_UniqueSellingPropositionItem.cshtml

That should be rendered for each item.


I modified the The Home layer and attached the Unique Selling Proposition Item (selecting on it the query before) to the Zone Content.

The bad news is that I get an ul tag item for the query widget, and only an <p> element with the body for the text.

Never is rendered.

In the other hand, I can see a Display Type: Summary for the model.

I tried to change the name of the view, and appended to it the Summary word, but is rendered as text and as paragraph.

So I'm a little missed.

I created an alternate to List, to remove the ul, but I can't do it...

Well, you can see, I don't know what to do.

I want a clean rendering of each item, that are a div with styles and tags.

Thans for the before response!
Feb 28, 2014 at 7:43 PM
Edited Feb 28, 2014 at 8:48 PM
I think you have two options: alternates (what you are trying now) and using a custom layout in the query.

I explored the custom layout option and it is amazing how it lets you customize the rendered html.
I added a new layout to my query and used "raw":
https://onedrive.live.com/redir?resid=DE1460E20BED502C!1790&authkey=!ABxWFK9NlguU3u4&v=3&ithint=photo%2c.png

Then Add the parts that you want to show. I have two:
https://onedrive.live.com/redir?resid=DE1460E20BED502C!1793&authkey=!AJO_i8GliJteevY&v=3&ithint=photo%2c.png
https://onedrive.live.com/redir?resid=DE1460E20BED502C!1791&authkey=!ACAM3Epps-89m5g&v=3&ithint=photo%2c.png

Remember to change your widget to use the new layout. If you forget it you will not see any changes.
And maybe is a good idea to delete the alternate you created.

In case you still prefer the alternates option, I assume you are using shape tracing module to create your files, right? If not, you should enable it because it makes much more easier to figure out alternate names.
Mar 1, 2014 at 5:14 PM
Hi, This is a great help to me.
an image is worth a thousand words

Is what I need, thanks


2014-02-28 20:43 GMT+01:00 mmolleja <[email removed]>:

From: mmolleja

I think you have two options: alternates (what you are trying now) and using a custom layout in the query.

I explored the custom layout option and it is amazing how it lets you customize the rendered html.
I added a new layout to my query and used "raw":
https://onedrive.live.com/redir?resid=DE1460E20BED502C!1790&authkey=!ABxWFK9NlguU3u4&v=3&ithint=photo%2c.png

Then Add the parts that you want to show. I have two:
https://onedrive.live.com/redir?resid=DE1460E20BED502C!1792&authkey=!AEnNnzGFH921qhA&v=3&ithint=photo%2c.png
https://onedrive.live.com/redir?resid=DE1460E20BED502C!1791&authkey=!ACAM3Epps-89m5g&v=3&ithint=photo%2c.png

Remember change your widget to use the new layout. If you forget it you will not see any changes.
And maybe is a good idea to delete the alternate you created.

In case you still prefer the alternates option, I assume you are using shape tracing module to create your files, right? If not, you should enable it because it makes much more easier to figure out alternate names.

Read the full discussion online.

To add a post to this discussion, reply to this email ([email removed])

To start a new discussion for this project, email [email removed]

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com




--