Creating Dynamic Visibility

Posted by Community Admin on 03-Aug-2018 17:35

Creating Dynamic Visibility

All Replies

Posted by Community Admin on 28-Aug-2013 00:00

Hi.  I am brand new to Sitefinity and am working with Sitefinity 6.0 and Visual Studios 2010 Professional.  I am trying to figure out how to create a page that has a category list, a widget with documents, and a widget with videos, where the documents and videos displayed are determined by the category selected from the category list. Some basic dynamic visibility. 

I am trying to duplicate the example shown in Working With Related Dynamic Content Items in Sitefinity.  I am in Step 2, Modify the content type to include the Related apps field.  I complete the steps up to Update the widget template of the Apps so that it reflects the changes in the module structure.   Everything seems OK. 

The next step is to go to Content-Apps and add some items.  When I do this and click the Create an app, I get the following error:

 The control of type 'ASP.mydynamicitemsfieldcontrolselector1_ascx' does not implement IField
interface. All fields must implement IField interface.

I have searched for a solution with no success.  I searched the forum for All fields must implement IField interface. I read the posts that came up, but didn’t understand them. I am entering the
virtual path of the custom widget when setting up the field, but still getting the error message.

Can anyone point me in the correct direction to resolve my error message so I can continue trying
to duplicate the example?

Second, can someone please give me a short outline on how to create the dynamic visibility I want?  I am sure this is a very basic function that everyone uses, but I am clueless on how to accomplish it.

Thanks!
Kevin

Posted by Community Admin on 02-Sep-2013 00:00

Hi Kevin,

First let me start by saying that you do not have to follow that guide in order to implement what you call "dynamic visibility". That guide is only relevant when you want to create a relation between two types of items. When you want to associate items with categories - it's much easier.

You don't need to create any custom fields. Instead, you can assign a category for each document that you upload. Once uploaded, just click the document and a screen with its properties will show. In that screen there is a section "Categories and tags". You can click to add categories to the item, or create some if you don't have any.



Once you have associated some items with a category, you can create a page and put two widgets on it - one to display the documents (Download list), and another to display the categories (Categories widget, found in the Classifications section of the toolbox). In order to let the Categories widget know what categories it should display, you need to set one property. This property instructs it what type of items it is working with. Click Edit on the Categories widget and in the screen that opens, find the ContentType textbox. For working with documents, you have to enter the value "Telerik.Sitefinity.Libraries.Model.Document".



Once you save and publish the page, you will be able to filter documents by clicking on the categories. This procedure works for all built-in modules. If you want to use it for a dynamic module that you have created, it is a bit different. Let me know if that is the case.

Regards,
Slavo
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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 04-Sep-2013 00:00

Slavo,
Thanks very much for your reply!  I will try the process you described.
Thanks again!
Kevin

Posted by Community Admin on 09-Sep-2013 00:00

Slavo,
Thanks.  I have duplicated your instructions and now have a document list and a categories widget.  The categories widget is operating properly, changing my documents based on category selection.  Now, how do I add a video gallery also controlled by the category widget?  I want both  the visible documents and the visible videos to be controlled by a single category box.  Can the category widget ContentType be modified in some way so that it controls both?

OK, I went it and changed the word DOCUMENT to VIDEO in the ContentType box.  Now it seems to be controlling both. Is that the way it is supposed to work?  I am confused!  lol

lol, my third edit to this post!  But now I finally understand.  Setting the content type to what you show above limits the control to documents.  If I leave the content type block blank, it will control all the widgets on the page.  Do I finally understand this properly?  :-)

Thanks!
Kevin

This thread is closed