creating list in Orchard - orchardcms

I have a custom content type, I going to create a list of my content type
I found & read the great orchard guide for creating list of content type in this link: http://docs.orchardproject.net/Documentation/Creating-lists
1. Now, instead of using admin dashboard for creating lists, how can I handle this work(create a list of my content type) using code?
2. how do I do if I going to don't show my content type in dashboard panel for creating new item of my content type, and replace of it , show the link of "Create new list of my content type"?
thanks a lot

Related

Content Type Not Updated docx,xlsx,pptx in SharePoint

SharePoint library items has document has (.docx, .xlsx, .pptx) extension and item associated with custom content type(Blank word document, Document). When user tries to change custom content type to OOTB content type(Document). It’s not updating even there is no error.
Steps to Reproduce:
1.Create a custom content type that parent as "Document".
2.Associate the content type into the document library and add "content types" to All documents view.
3.When library items has document has (.docx,.xlsx,.pptx) extension and item associated with custom content type.
4.Now try to change custom content type to OOTB "Document" content type and vice-versa.
5.It’s not updating even there is no error.
Please help on this i faced this issue only in (.docx,.xlsx,.pptx) extensions.
Thanks,
Rajendhiran M
Which SharePoint version are you using? May be you can monitor/check SPLogs while updating the content type.

SharePoint 2013 TaxonomyFieldType in custom list has IsTermSetValid = False

I'm using Visual Studio 2012 to create a custom Site Column of type TaxonomyFieldType, a custom content type that uses it, and a custom list that uses the content type.
Everything appears to deploy fine. If I look at my custom site column it appears to reference the proper termset correctly. I can create a new list in the web UI that uses my custom content type just fine. However, my custom list created using the Visual Studio 2012 List template always shows my taxonomy field as disabled on the new form. Here are the other things I've witnessed about it:
In the web UI of SharePoint, if I go to the list properties and drill into my taxonomy site column I notice it shows that it isn't mapped to a termset. Keep in mind that if I do the same thing in Site Settings for my content type it appears correct. I can do the same thing for the web UI created custom list and everything is fine (editable in the new form and the field has the termset defined).
If I use powershell to dump out the info for the site column itself it has a valid termset.
If I use powershell to dump out the info for the field in the VS2012 created list it shows emtpy guid for the SspId, TermSetId, and TextField. It also shows IsTermSetValid = False.
If I use powershell to dump out the info for the field in the SharePoint web UI created list it shows the correct guid for the SspId, TermSetId, and TextField. It also shows IsTermSetValid = True.
Does anyone know why I seem to be having this behavior for the VS 2012 create custom list? Any help is appreciated.
Okay, so I'm going to answer my own question. Hopefully this will help someone else in the future.
My issue was that when creating a sample list for my content type (described in original question post), using the SharePoint UI, the needed Note field was getting added. Even if I had this right in my original TaxonomyFieldType declaration, I would have also ran into issues with my field values not showing up in the search refiners later on when I got to that part. Thankfully Ari Bakker has written a very detail explanation of what all you need to do in order to create your custom TaxonomyFieldType derived field, a custom content type to use it, a list definition, and a list instance. Just follow the details in the article: http://www.sharepointconfig.com/2011/03/the-complete-guide-to-provisioning-sharepoint-2010-managed-metadata-fields/

Orchard cms,create a list of selected content on admin menu

I am trying to make a list of a specific content type by making a query and show the list on the admin menu. I created a projection to associate the query and added to the admin menu. But when I click on the menu created, it navigates to the edit mode of the projection definition but I was expecting a list. Can anybody help how to create a list of selected content type which can access from admin menu?
Regards
George
There are examples of code adding custom lists of content items in Vandelay.Industries. The repo for Vandelay can be found here.
The way it works is that it actually just creates admin menu items that point to the existing Admin controller in the Content feature that displays lists of content items. That controller is already equipped for filtering items by content type.
item.Action("List", "Admin",
new RouteValueDictionary {
{"area", "Contents"},
{"model.Id", definition.Name}
})
You can find the controller in question in the Orchard repo, if you want to write your own version for your own specific purposes (but again, you don't need to if you just want to display items filtered by type in the admin in a way consistent with the rest of the dashboard).
The relevant code is this:
_contentManager.Query(versionOptions, model.TypeName);

RenderingTemplate for ListForm Type

I created a custom RenderingTemplate "viewInventory" copy of ListForm
rendering template. It looks like below. Then I associated the
Rendering Template to a content type (this is list type content type)
EditFormTemplateName. But it seems the list is not even using this
controltemplate because I put a vogus name for editformtemplatename
and sharepoint did not complaint about it.
This exact scenario works for document renderingtemplate. Go figure.
Because you have set Inherits="True" in your content type definition, SharePoint ignores your XmlDocuments section when the solution is deployed, therefore your content type after deployment has no reference to your custom form templates.
Set Inherits to FALSE..
All I had to do is to associate "viewInventory" with both NewFormTemplateName and EditFormTemplateName of the content type through Sharepoint Manager 2007. (or you could do it feature attributes)

Export a SharePoint Custom Content Type That Inherits from Contact to Outlook

I've created a custom content type that inherits from the built in Contact content type in WSS 3.0. When I create a list instance and assign my custom content type, there is no "Connect to Outlook" option like there would be if an end user created a new "Contact" directly. Am I doing something wrong or is this a limitation of SharePoint?
The relevant part of my feature looks like this:
<ContentType
ID="0x010600C4945CA38AAB46cdA161C4146965F0E3"
Any help would be greatly appreciated.
The "connect to Outlook" is a function of the list, not the content type. I.e. you can have multiple content types for a Contact list, but you will need to create a list based on a Contact list to get the additional features you require.
For a test to see what I mean, create a contact list, go to the advanced settings for the list and Allow management of content types. Add your custom content type and remove the default contact.
Now for giggles, delete your custom content type and add the Announcement content type. You will still be able to "Connect to Outlook".
Hopefully that demonstrates that the content type is mainly about the fields available to the listitem stored as that particular content type.

Resources