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

Forums / Developing with Sitefinity / Couple of questions about content view

Couple of questions about content view

7 posts, 0 answered
  1. Lyn
    Lyn avatar
    15 posts
    Registered:
    30 Apr 2008
    25 Jun 2008
    Link to this post
    Hi,

    We are using a number of Generic Content providers for a number of content items such as "People Profiles" and have got the following questions:

    1. Image field in ContentViewSingleItem - Thumbnail url field  in our generic content provider but can't work out how to output this into the ContentViewSingleItem.ascx. have tried the following to no avail:

    <asp:Image ID="Thumbnail" runat="server" ImageUrl='<% = this.Text %>' /> 

    2. Group headings by category in ContentViewItemList - designer has come out with the following layout for the items list which involves grouping the content items by category names. Is it possible to achieve this without developing a new control:

    Category 1

    Generic content item 1
    Generic content item 2
    Generic content item 3
    Generic content item 4

    Category 2

    Generic content item 5
    Generic content item 6
    Generic content item 7

    etc.

    3. Paging in the contentviewsingleitem - there seems to be a setting in the properties to activate paging between items in the single item view however setting it to true does nothing.

    Is there some extra code that is required in the contentviewsingleitem.ascx to make this work?

    Thanks


  2. UI Crew
    UI Crew avatar
    99 posts
    Registered:
    24 Sep 2012
    27 Jun 2008
    Link to this post
    Hi,

    Is someone able to answer any of these questions from experience?

    Thanks

    Seth
  3. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    28 Jun 2008
    Link to this post
    Hello Seth Cleaver,

    The answer to the first two questions is that you should override the ContentView control. GetMetaData() is the method that is responsible for taking data from the metafields, it should be overridden in order to make it work with images tags.
    There are two approaches for question 2 - as I mentioned the first one is to override the control - you could implement nested repeaters. The parent should be bound to categories, while the child one - to the categories items. The other approach could be using several controls, each filtering for one category only.

    Paging in the ContentViewSingleItem has been implemented only for Blogs. We could try to find a solution to make it work with the other modules as well if you really need it. Let us know about that.

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  4. UI Crew
    UI Crew avatar
    99 posts
    Registered:
    24 Sep 2012
    01 Jul 2008
    Link to this post
    Hi Georgi,

    Thanks for your answer.

    Can I ask why does assigning the Thumbnail field to a hyperlink control in the same way as I have done the image control work but the image control does not? Just for interest sake.

    On the Paging in the ContentViewSingleItem question - I asked this because originally the old "Single News" control had the paging it in and now we are upgrading to the newer NewsView it does not.

    Also we have a generic content provider for "people profiles" that has been designed with "Next and "previous" controls at the bottom of the page so I thought i would ask the question.

    Thanks

    Seth
  5. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    04 Jul 2008
    Link to this post
    Hello Seth,

    The answer to your question about the Image control is that it depends on the specific implementation of the corresponding control. For example, Content View control iterates through all meta fields of the provider, finds the ITextControl control in the template with ID that corresponds to the given meta key, gets the meta field value with GetMetaData method and then sets it to the Text property of the ITextControl control.

    That is why you need to create your own control that will implement the specific functionality which you want to achieve. Please, refer to the new Developer Manual (Developer Manual (CHM version)) that describes in details how to extend Content View control:
    Developing with Sitefinity > Controls > Extending Built-in Controls in Sitefinity > Example: Extending Content View Control

    Hope the information is helpful for you.

    Kind regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Brian Lee
    Brian Lee avatar
    3 posts
    Registered:
    07 Nov 2006
    05 Nov 2008
    Link to this post
    Can you provide sample code for binding the repeater to Categories and the child repeater to Category Items.

    Thanks,
    Brian
  7. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    06 Nov 2008
    Link to this post
    Hi Brian,

    Please refer to the following Developer Manual topic that provides examples how to retrieve one or more categories: Finding Categories. To bind a repeater that should list all categories for a given provider, you need to use some of the GetCategories method overloads.

    Do let us know if you need any further assistance.

    Regards,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
7 posts, 0 answered