Checkbox list in Orchard CMS - orchardcms

Is there any module in Orchard CMS that I can install to get a checkbox list? I checked in the gallery but could not find one. If there is none, is there is a workaround this?
I want to associate a product item with multiple categories (fixed set of categories).
Thanks!
EDIT :
I checked the Taxonomy module as per the suggestion. Now, I want to access the terms in the view. I have seen some posts where they can access it using
(IEnumerable<Contrib.Taxonomies.Models.TermPart>)Model.Terms
Using shape tracing, I am trying to figure out how to access the terms. My model doesn't have any terms field! I can access my custom type (Project) which has 'ProjectCategory' as Taxonomy Field. But there is no mean to view/select terms from there.
See attached screenshots.
Any idea?

I don't think there is a module specifically for checkbox lists, but it sounds like the Taxonomies module might be what you're looking for. You can add a Taxonomy field to your product content type, and define a Taxonomy for that field that contains all your categories.
Once you do that the editor page for your products will have a checkbox list (or radio select if you allow only one in the taxonomy field's settings) for the "Categories" taxonomy.

I managed to access the terms the following way :
IEnumerable<TermPart> assignedTerms = _taxonomyService.GetTermsForContentItem(contentItemId, "NameOfTaxonomy");

Related

Orchard CMS - dynamic query based on TaxonomyField of current content

I am looking into using Orchard CMS for an upcoming project and have hit a block. The site need to display articles of various types alongside a list of recent articles of the same type.
To that end I have:
Created a custom ContentType called Article which includes a TaxonomyField for ArticleType.
Created a custom theme with zones to reproduce the layout the customer requires. (Including RecentArticles.)
Created a custom widget layer to show/hide the RecentArticles zone based on the current ContentType. (I.e. the RecentArticles zone is only populated when we are displaying an Article.)
Created a Projection to show recent content of type Article.
I see that I can use the ArticleType taxonomy field to filter the source of the underlying query of part 4. However I need that filtering to be dynamic based on the ArticleType of the currently displaying content.
Is this possible? Is there an alternative way to reach the same result?
Thanks in advance.

Need to display list of product categories

I'm exploring Nwazet.Commerce module and I've managed to replicate most of what http://nwazet.com/ does ... However I'm struggling with projection widget that displays product categorization (on nwazet.com page one to the right that has Automation, Cables & Connections, ...).
I assume these are terms for a taxonomy? How should I set projection query to get this list of terms from a single taxonomy? When I tried "Content with type CategoryTerm" it lists not just terms but also products that have them.
Thanks for any pointers.
You got it exactly right: the categories are taxonomy terms. The problem is very likely that you are displaying the terms in the projection query layout with the full detail view, where the term will display the list of items under itself. Instead, you could use a summary or a custom display type in your layout, and customize the template alternate for that display type. Alternatively, and this is how the site is set-up, you can switch to property mode for the layout and just keep it to a simple display text property with "link to the item" checked.
Some additional info: for perf, I add an eager fetch filter on Autoroute and Title part records.

Get listitems from Current Site

I am trying to create a Page Layout, that should have a lookup field. Lookup field should always get populated with a list's items.
This list will exist in all subsites, so whereever I create this page, list should get populated with listitems from current site.
I tried using site column lookup field, but it always point to list under top site and not the current site.
Any suggestion on how to make it work or better alternative? Thanks!
Let me know if I can provide more info.
The most straightforward solution I can think of is using a cross site lookup column and creating a seperate fields for each subsite. However, you will need to create and use different Page Layouts for each subsite.
You can use http://sp2010filteredlookup.codeplex.com/ for cross site lookups.
Solution 1 - Use http://sp2010filteredlookup.codeplex.com/
Use filtered lookup solution. So let's say you have your custom Page Layout and custom Page Content Type.
Every time you create new subsite, you should remember go to Pages list settings and edit Page Content Type by adding cross site lookup (with the same field "internal name").
So you still have one Page Layout (and one Content Type). But for each Pages library instance, Content Type contains diff fields (but with the same Internal Name). It will allow you run CAML queries and other things needed without any problems.
Solution 2 - develop custom sharepoint field type.
In edit mode, control will render "dropdown list" and populate data from list instance that is on current subsite. In the field settings you can have relative list url.
Solution 3 - hidden text field / js snippet solution
Page Content Type can contain hidden text field (it can contains selected field value in json format for example). Develop js snippet that will handle all the logic (rendering in edit/view mode, saving etc) and put it on Page Layout (aspx).
I would suggest to use solution #1 or #2.

Create a list of pages in Orchard

Lets say for example, I have a list of products that each have it's own page... in what way can I create a single page that will list each product as it's contents as a list (with hyperlinks)? Not really sure how to do this directly in Orchard - or will I need to create a custom page / widget? Thanks for any help... new to Orchard and not sure how to tackle this.
You have a couple options. I believe the Orchard gallery at orchardproject.net has a module called Simple Commerce that may solve your problem. (it's simple so it might not)
(In the following section, I've tried to boldface the terminology words that are 1) are crucial to understanding how to use Orchard and 2) helpful in finding your way around the dashboard)
Another option may be first creating a Content Type--probably one named Product with some Fields describing an individual product. Price, SKU and description come to mind, but you'll be better able to describe your own products. Each Content Type in Orchard can be associated with any combination of Parts. You may have to research which ones you actually want for an individual product, but I'd recommend:
Body (this could replace the Description I suggested above) You could include any amount of HTML/script in this section to make your individual product pages look fancy!
Common (this has to be added when Containable is used)
Containable (this will allow the items to be listed)
Route (so you can link to a specific product)
This gives each product its own slug (URL)
Tags (to allow products to be categorized)
Now, you need to create a new List from the dashboard so you can display the products together (and inherit other features like pagination, etc). Be sure to select the Product Content Type in the Contains drop down list.
Then, you can start creating your Content (your Products) one by one. In the dashboard, click the new Product item and describe each new piece of Content.
Finally, you can link directly to this new List using the Products List's *slug*. You could (and might want to) add the Products List to your main navigation menu. Clicking the Products List and checking the "Show on main menu" box will automagically add a navigation button directly to this page. You could, of course, link to this List from anywhere using the slug (also found on the list's edit page)
This page, from the Orchard documentation pages describes more things you can do with a list of content like modifying the layout of the list, placing content fields in different places and even converting your products to widgets which you could use to display some promotional product offering in a special spot on your site.
I highly recommend reading through at least the documentation provided on the Orchard site to get a good grasp of what this CMS can do out of the box and what you would need to write custom code to accomplish (which you could do in this case, but Orchard can handle it out of the box)
Hope this helps!
Two ways to do this:
http://orchardproject.net/docs/Creating-lists.ashx and http://orchardproject.net/gallery/List/Modules/Orchard.Module.Contrib.Taxonomies

How can I hide the taxonomy field for authenticated users but show it for other users in Drupal 6?

I have a Drupal (v6.17) Content Type which includes a Taxonomy field. I want to hide this from ordinary Authenticated Users, but want it available to my Site Contributor role users, so they can review and then assign tags to user-created nodes.
I've tried overriding the Node Add/Edit form in Panels 3 by creating a panel variant especially for Authenticated Users, which would exclude the Taxonomy field. However, the Taxonomy field is bundled in with the "General Form" controls - without showing this, I don't get the Title and Body fields.
Is there a way I can either include the Title and Body fields without Taxonomy, OR hide just the Taxonomy field when the authenticated user role creates a node.
I realise there's a CCK field which might be able to help me out here, but how do I tie that to the Taxonomy module?
Any help gratefully received.
here is a solution that worked for me.
I use the content taxonomy cck field for taxonomy in custom CCK content type. So I can use the CCK field permission module (comes bundled with CCK) to show/hide the field based on the user role.
Content taxonomy can save terms to the field table and/or to the taxonomy table(s). It also comes with different input widgets beside checkbox and select.
Regards
Mike

Resources