Orchard CMS. Nested items on summary page - orchardcms

I'm new to Orchard CMS and has a question about how to implement displaying nested items in search results.
Let's say I have a content type Box which describes box of books. And I have Book content type. Book content items can be contained in box.
I need to build a page that displays all books grouped by boxes i.e. List of boxes and list of books for them. All in one page.
Not sure what is the best way to implement this.
Thanks

I would recommend looking into the content picker field. You can attach this to your Box type and then each time you create a box you can select all the books you want to add to your box. You will need to have created all the relevant books before creating your box. You can have a setting on the content picker field so that it only displays certain content types, I suppose in your case it would be the Book content type
David Hayden has a nice introduction to the content picker field, available here: http://www.davidhayden.me/blog/content-picker-has-content-type-filtering-in-orchard-cms

Related

XPages newbie - view columns in discussion database

I'm a traditional domino developer just beginning XPages. I'm working on modifying the standard 8.5.3 Domino discussion database. I've added some fields on the Main Topic and response forms, one called category. I've added a categorised column in the ($xpAllDocuments) view to the left of "Topic" for the category field. This works fine in Notes as you'd expect, but when the view is rendered in the All Documents xpage, the category twiste displays without any label. I'm not sure how to modify the column data for the xpage, as it seems to use a repeat? instead of a view?
Any help greatly appreciated, and apologies for the presumably basic enquiry!
You have to add the categories column to custom control allDocumentsView which renders the view for browser.
How to find out where to set the new categorized column? A good way is to look at the "All properties" of a certain element. For that, open the Source pane of custom control allDocumentsView, position cursor on <xe:dataView and look at "All Properties". If you hover over the properties' labels you get a helper window with a short explanation.
In your case, property categoryColumn is what you are looking for. Assuming you added a categorized column Categories to view ($xpAllDocuments) then you would have to put into property categoryColumn:
With that, your source code gets expanded by
<xe:this.categoryColumn>
<xe:viewCategoryColumn
columnName="Categories"
columnTitle="Categories">
</xe:viewCategoryColumn>
</xe:this.categoryColumn>
and you will see the added categorized column in your rendered XPage.
I don't know the discussion template in detail, but when the All Documents Xpage is using a repeat control, then you cannot expect an automatic category expand/collapse feature as in a Notes view.
If you want that, you need a View control on the Xpage.

SharePoint: Customize Search Results Refinement Panel

I know there are threads out there about making changes to the refinement panel and they have so far been very helpful but now I have a question that I need a bit more assistance with.
In the search results, would there be a way to add a filter to the refinement planel that would filter based on a tag I have used in a column in the libray?
For example, let's say I have three committees that meet every week and I have minutes for all of them. In my search results, I may want to look up a keyword discussed, but only interested in a certain committee. This would have already been identified in a column in the library.
How do i do this? I believe it has something to do with mapped properties but I need some steps from someone willing to help! TY :)
First you need to add a new mapped property in your search service application and map it to the crawled property that contains the field you want to filter by.
You can then refer to this mapped property when you edit you refinement panel on your search results page.
To do this, edit your search results page and then edit the refinement panel web part. Under Refinement section you need to edit the Filter Category Definition XML and then save your page.

How to display count of documents beside webpart title of a document library ?

A requirement in our project is, we have to show the count of documents beside web part title name. I have tried using Data view web part (using XSLT) but unable to display the count beside the title.
Can you please suggest any other alternative to meet the above requirement without using custom code?
If you want the total count of the documents in a document library you can get from
xsl:value-of select="count(/dsQueryResponse/Rows/Row)"
Or
Open the data view web part properties and on the General tab select the show view footer. It will show the count of the documents

Adding column item as a link in sharepoint

How do I add an item in a column as a link in a list in Sharepoint Server 2010?
What is the type of column which is showing link to another document?
Let me see if i understand you correctly.
You have seen the browse for document link in publishing sites, and you want this functionality in your standard list.
Unfortuately you cannot do this, the standard data types are:
http://office.microsoft.com/en-us/windows-sharepoint-services-help/create-a-site-column-HA010157769.aspx
So you are left with just plain old Hyperlink, which doesn't have the browse for document box.
If you try to create a site column with the datatype Publishing Hyperlink, and add it to your list, you should get an error message when you try to browse
"Cannot complete action"
You can add Calculated Value column in the list, and specify the formula for the column which will redirect you to the desired location.
You can do this with jQuery by parsing the link from the title with link or edit button. But also, if you want a non client side solution, there is a good article here http://www.sharepoint911.com/blogs/jennifer/Lists/Posts/Post.aspx?ID=70 on how to add a column and using a workflow fill that column with a "quick link" that the user can provide to people wanting to link to there document. It is a general approach that I think you can see could be adapted to various needs.
For a head start on a jQuery solution check out http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/ebda8a32-a6cc-49fa-b7e4-81f762b26266/
In order to link document with list item, you can create "Hyperlink with formatting and constraints for publishing" site column and add it to any list.
If you need to browse and upload multiple files per list item, you can use 3rd party add-ons like Sparqube Document column.

Can I change the column that links to the item with edit menu in a sharepoint list?

There was a similar question asked but it wasn't exactly what I am trying to do.
Here is a link to the question: Auto Number Column in SharePoint List with Link to Item
Two solutons were offered to that question.
Could either of these solutions work for an imported list I have where Sharepoint has decided which column links to the item with edit menu? I want to change which column does this as I need to change the format and this means removing the column that has defaulted to being the link to item with edit menu.
You cannot dynamically change the menu column OOTB in SharePoint. To "move" the menu to a different column, you should create a new computed column and wrap the rendering (DisplayPattern) with the _EditMenuTableStart and _EditMenuTableEnd fields.
To see an example of how to do this, take a look at the "AddMenuColumn" PowerShell script from the iLoveSharePoint project on CodePlex. The script is pretty straightforward, so you should be able to translate it into code if you need that (or add declarative using features).
You could also just use the script as it is, to add the new menu column to your list.

Resources