In Orchard CMS, is there a way to display a list based on tags of a content type? - orchardcms

I created a custom content type "books" and I'm attaching tags to each item (i.e. "Featured", "New", "Children's", "Adults").
I'd like to create lists of books to display based on their tag. For example, I'd like a "Featured" list that displays all the books that have been tagged "Featured", and a "Children's Books" list that displays all the books that have been tagged "Children's".
Is there a simple way to do this (for a visual UI person who's blood pressure rises every time she has to go into the code?) :)

Taxonomies are the best way to do this. Well, tags can do that too but taxonomies are much richer.
So simplest way: yoursite/tags/featured will display all contents tagged with "featured". A little more elaborate way: taxonomies.

Related

How to display databases values with fltk widgets

I'm developing an application - written in rust, that registers items in a database, but I'm having trouble showing the data in a way that is visually good, I tried to use the Browser widget but it's not visually appealing. I have a struct Items that store name, quantity and price, and a vector of Items that stores the field values, how can I show the items stored in the database, and what is the best widget to do that?
Natural choice would be to use the Fl_Table and Fl_Table_Row classes in your project.
Greg Ercolano has an example how to use them at https://www.seriss.com/people/erco/fltk/Fl_Table/ . In fact, he is the original author of these classes, later on they got into the FLTK itself...
Do not be confused with the screenshot when you see those buttons inside the table. - He just wanted to demonstrate that you can put any Widget in Fl_Table cells.

Orchard CMS Lists - how to replicate using Taxonomies

I'm new to Orchard but from various blog posts and SO answers it seems that Lists would help me achieve what I want. Unfortunately it seems that Lists have now been deprecated.
The documentation at http://docs.orchardproject.net/Documentation/Creating-lists suggests using Taxonomies instead. Is it possible to achieve the functionality of a List using Taxonomies?
You can use taxonomies to produce a list of content items. Create your taxonomy, add some items to it, attach the taxonomy field to your content type, and select the taxonomy you want to be displayed in the content type settings. Create a content item with a taxonomy selected then go to the url:
/taxonomy-name/*selected-taxonomy-item*
and it should display a list of all items with that taxonomy selected.
However, lists were deprecated and replaced by Projections, I would recommend using these. They are part of core and can be enabled from the backend. You can then create a query with your projection uses. This query determines what items you want displaying. It is pretty nice and simple, just need to play around with it. Let me know if you need more details about it, or probably just googling Orchard Projections will produce some useful links if you need to do some more complex things with it

how to render custom layout of the projection of known content items

I have defined my own projection by a query which returns a set of content items of known content type. I would like to take pick up certain content parts of these content items and display them in the list. Using shape tracing tool I have found the view template where to write my custom layout:
/Views/Parts.ProjectionPart.cshtml
but from the Model variable in the template I can not get the data I want because it is way too high above from the content parts data.
a good example of what I want: let's say I want to render product catalog as defined in this tutorial:
http://skywalkersoftwaredevelopment.net/blog/writing-an-orchard-webshop-module-from-scratch-part-5
but I want only to render a list which consists from items:
name of the owner who created the product
name of the product.
publish date of the product
and I need to render it at one place, i.e., not separately in their own part views.
Have you tried adding a layout in the projector module? There is a properties mode option that lets you select which fields/data to show. If the data you want is not there, you should be able to implement an IPropertyProvider. There are examples of this in the Projections module code.

Sorting and filtering lists in Orchard

I've followed the topic 'Creating lists' in the Orchard Project docs but I'm struggling to think how best to implement my preferred sort order and direction in the resulting rendering of Summary display of the content items.
For example, if I create a Book Reviews list as in the example, and I then add a Published Date field following the topic 'Creating a custom field type' then how would I alter my theme or the views in the Module to display (and possibly also filter) the content items by that custom field.
The 'Creating lists' topic discusses how widgets can implement sorting and filtering, but not how the main content type can do so.
p.s. if you know the answer to this you're probably well on the way to being able to implement an Event Calendar Module as suggested by the Orchard Module Challenge; why not have a go and stand a chance to win a TV / XBox / KINECT!
Research to date:
I've noticed that ordering in a Container part is implemented using the following property
OrderByProperty
(Orchard.Core.Containers.Models.ContainerPartRecord)
In Orchard 1.4 you can Projection Module to achieve that.
In previous versions, I used LINQ queries to do the sorting on the custom field.

Modify sharepoint view to group recursively (subgroup)

When creating a view and setting group by value some field, it groups only 1 level deep, like this
A
--A.1
--A.2
A.2
--A.2.1
--A.2.2
B
--B.1
However i would like to group it to make a tree, a hierarchy.
A
--A.1
--A.2
----A.2.1
----A.2.2
B
--B.1
A flawless solution would be if i could just make my custom views to view a recursively grouped items.
Any ideas how to achieve that?
It should look something like this:
alt text http://img6.imageshack.us/img6/1958/ss20090703135209.png
You would need to build your own ListView Webpart. However, there is already a third party product that does this, the Bamboo Solutions tree View WebPart
You will need to get the data from maybe a content query web part and format it with your own XSLT.
XSL is not the easist to do this with as it has no "stack" structure for easily nesting a linear list.

Resources