Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > document type - webpart problem View modes: 
User avatar
Member
Member
tjadoon-gmail - 8/22/2010 12:16:15 PM
   
document type - webpart problem
I am new and trying to learn...

I have a document type that consists of:

* ID
* TypeID
* Title
* Description
* Image

On the page i have 3 (columns) repeaters to show information per the TypeID. Title field gets displayed here. This is showing.

I want to do some thing like following and here i am lost:

On the same page, when it loads for the first time, i want to show a randomly selected information from the 3 columns. Here Description and the image will show right underneath the 3 columns.

When some one clicks the title ( from either of the 3 columns), i want to hide the above description and image and show a new clicked one in its place.

How can i accomplish this?

Thanks

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 8/23/2010 11:02:27 AM
   
RE:document type - webpart problem
Hi

Could you please use following structure of your documents:

-Your Documents
---Type 1
---Type 2
---Type 3

In Your Document you will need to use your 3 repeaters and for displaying random document you can use random document webpart. You will need to set Document type, Path and Transformation which should be used.
You can set visibility of this webpart to be displayed only on this document using following macro:
{%cmscontext.currentdocument.documentname == "Your Document"%}
So this random product will be displayed only on Your Document page.

Each of Type 1, Type 2, Type 3 pages will inherit content of parent (3 repeaters) + add repeater webpart that will display only documents of type 1 or type 2 or type 3 on each document and set Path to . (actual directory).

You can find inspiration in Kentico CMS Corporate site (please look at Products documents).

Best regards,
Ivana Tomanickova






User avatar
Member
Member
tjadoon-gmail - 8/25/2010 10:41:06 AM
   
RE:document type - webpart problem
I understood upto the random document webpart but i am lost after that (second paragraph). :(


User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/6/2010 9:52:17 AM
   
RE:document type - webpart problem
Hi,

you can find inspiration on default Corporate site. Please take a look at Products part. There is following content (simplified):

Products
---PDAs
-----PDA1
-----PDA2
---Laptops
-----Laptop1
-----Laptop2


You can insert your 3 repeaters (columns) on Products page. The template with content will be inherited in PDAs (Type 1) and Laptops (Type 2) page. There is also datalist webpart used on Products page and this one is inherited in subpages. To cover this webpart on Product page you can use following macro and set Visibility in Properties of webpart:

{%cmscontext.currentdocument.documentname != "Products"%}

This macro hides datalist webpart on Product document. Now you can insert random document webpart here. This part will be visible only on Products page if you tick Hide on subpages option in properties of webpart. How to use this webpart is shown in Examples/Listings and Viewers/Random document.

Alternatively, if you are not using subpages as PDAs, Laptops, you can use Show for document types property of webpart. For random document set Page (menuitem) and for datalist webpart set your_document_type.

Now you should have random product visible on Product page and Product of Type1, 2,3 on subpages (visible after clicking on one in 3 columns).

Best regards,
Ivana Tomanickova