+1-888-365-2779
Try Now
More in this section

Forums / Module Builder / How to display single custom content type

How to display single custom content type

5 posts, 1 answered
  1. Hooman
    Hooman avatar
    19 posts
    Registered:
    24 Jun 2016
    27 Jun
    Link to this post
    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?
  2. Hooman
    Hooman avatar
    19 posts
    Registered:
    24 Jun 2016
    27 Jun in reply to Hooman
    Link to this post
    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.
  3. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    29 Sep 2016
    01 Jul
    Link to this post
    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
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  4. Hooman
    Hooman avatar
    19 posts
    Registered:
    24 Jun 2016
    01 Jul
    Link to this post

    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..   

  5. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    29 Sep 2016
    06 Jul
    Link to this post
    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
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
    Answered
5 posts, 1 answered