How to display single custom content type
I have made a new module (Ideas). In Widget templates (under design) I noticed 2 widgets were auto created. One is list and the other detail. So far so good. When I go to the page and drag the content type from the right hand side it seems to only show the widget for list of ideas. I don't want to show the list widget on my page. On my page I want to simply show a single idea. Is there a way to do this without hacking the list template to basically be a detail template?
I went about this my making the list template loop through each item with each item markup being the same as the detail basically. Then on the page, edit the widget properties to limit the list to a single idea/content.
Hi Hooman,
In order to achieve your needs, and to get one particular Item in detail view, you need:
- Drop the widget of your type on the page
- Under its Edit menu select "One particular <your content type name> only..."
- Select the Item of your content type (screenshot) you need to display in details view
- Click Done and Save the settings.
Regards,
Svetoslav Manchev
Telerik
I forgot to mention we are using MVC/feather. When I drag my Promotions widget from the tool box to the page, there is no "One particular Promotion only...". See attached screenshot. I can select a single item in the edit scren, however that still calls the list template with a single item. It doesn't display the detail template I have chosen (see screen shot) - in this case called "Static Promotion" which is just a simple div..
Hi Hooman,
In that case you can select as you described a single Item and modify the list template to show the necessary fields you need:
- Go to Design > Widget templates
- Create a custom list template where to include all the fields you need
- Associate that template to your type (MVC)
You can get the respective code from the details view. Note that you need to change in that case "Model.Item.Fields..." to "item.Fields..."
I hope this helps.
Regards,
Svetoslav Manchev
Telerik by Progress