Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Visibililty of Specific Web Parts and Fields in a document based on field in document. View modes: 
User avatar
Member
Member
Ventrasoft - 10/18/2012 8:36:06 PM
   
Visibililty of Specific Web Parts and Fields in a document based on field in document.
Basically I have a Document Type that is for Businesses in a Business Directory. I have a multitude of fields as part of this document type.

On the page (Document) itself I use a alternative form for displaying the information about the business. I also use a rating control, a media library, comments section and a tab page control which contains lists of other hyperlinked documents.

I have three business levels, Basic, Enhanced and Full. Depending on what type of business partner they are, each business will be assigned to one of the three levels when they are created. This is done via a drop down list and I am storing it in the business document type.

Each level has fields as well as web parts that should and should not be displayed to the regular site user, which is dependent on what level the business is assigned. For example a basic business will not have their email shown, nor their website url as well as hiding the media gallery and the tab page control. An Enhanced business will have these shown.

So in essence the page (document) is dynamically configured when it is loaded based on what business level they are for display purposes.

I can code this in C# in my own project very easily buy just grabbing the data from the field on Page Load and setting labels, text boxes and objects visible property to true or false.

Rather than creating a custom control and custom web parts to do this, is there an easier way to accomplish this within Kentico. I would like to leverage the use of the alternative forms so that my client can change the layout in the future as well as leverage the cms and change the layout.

Any suggestions would really be welcome.... I am stumped.


User avatar
Member
Member
Ventrasoft - 10/18/2012 8:57:09 PM
   
RE:Visibililty of Specific Web Parts and Fields in a document based on field in document.
I would think that the easiest way to display the correct fields would be to just create multiple transformations and just load the correct transformation dynamically when the page is called based on the value of the field in the document. Not sure how to accomplish this and also to show or hide the webparts based on the same field.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 10/19/2012 2:08:22 AM
   
RE:Visibililty of Specific Web Parts and Fields in a document based on field in document.
hi,

Using conditions in the transformation is also one option.
Or, you can simply create just a simple custom transformation function with simple conditions.

Best regards,
Juraj Ondrus

User avatar
Member
Member
Ventrasoft - 10/19/2012 6:55:31 AM
   
RE:Visibililty of Specific Web Parts and Fields in a document based on field in document.
What about hiding certain web parts based on the field value that I am pulling from the document ?

User avatar
Guest
Ventrasoft - 10/20/2012 12:20:46 PM
   
RE:Visibililty of Specific Web Parts and Fields in a document based on field in document.
Any one have any ideas on this ????

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 10/21/2012 1:02:34 AM
   
RE:Visibililty of Specific Web Parts and Fields in a document based on field in document.
Hi,

You can use context macro in the Visibility field of the web part, or use the field in the WHERE condition to filter out the results you do not want to display (or do not display anything).

Best regards,
Juraj Ondrus