Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Flexible position of the documents View modes: 
User avatar
Member
Member
Leandro Brito - 9/14/2011 10:42:16 PM
   
Flexible position of the documents
Hello again,

More questions :)

Kentico has a flexible way to position the document type (news) in the page (webzone)?
I ask because my client has asked flexibility to choose where the document will appear but I haven't seen anything in the guides.

By example:

I have a div in my home page to show 4 news (four squares) and I want chooose what the position especific of the document (news) will appear 1, 2, 3 ou 4.

It's is possible?

Thanks

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/15/2011 5:10:03 AM
   
RE:Flexible position of the documents
Hi,

do you mean that news should be displayed the following way:

1 2
3 4

instead of

1
2
3
4

Or how the layout should look like?

In case of square layout you could use a datalist web part which allows you to define number of items in one line, so maybe it will help you.

Thank you in advance for detailed information.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
Leandro Brito - 9/15/2011 6:39:34 AM
   
RE:Flexible position of the documents
Hi,

Thanks for your answer.

Problem is choose the position of each document, by example
News 1 in positon 3 of square,
News 2 in position 1 of square...

Is possible do this?

Thank you!

User avatar
Member
Member
Tom - 9/15/2011 6:44:38 AM
   
RE:Flexible position of the documents
Are you saying you want to have four news items in total on the page & want the user to select which one is in each position?

User avatar
Member
Member
Leandro Brito - 9/15/2011 6:49:46 AM
   
RE:Flexible position of the documents
Yes Tom, the user (client) asked me if it is possible.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/15/2011 7:00:07 AM
   
RE:Flexible position of the documents
Hi,

you could add a custom field into the news document. Then the user could select on the form tab one of four values. Then in a transformation you could generate a div with class name defined by customer. For the class would be defined css definition so the news would be displayed in the selected corner.

The problem may be if customer selects the same value for two documents. Therefore you could create a custom form control which would check which position is still available. How to create a form control is described here:
http://devnet.kentico.com/docs/devguide/developing_form_controls.htm

Best regards,
Ivana Tomanickova

User avatar
Member
Member
Leandro Brito - 9/15/2011 8:32:01 AM
   
RE:Flexible position of the documents
Ivana

I think your solution will works fine.
Do you know how can I acess and check which position is still available in my code behind?
What is the namespace, class etc?

Thanks

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/16/2011 3:26:18 AM
   
RE:Flexible position of the documents
Hi,

in your custom form control you could select a news documents using document API and get values of your field. Then you could dynamically fill the dropdown list control. How to get value of field is described here:
http://devnet.kentico.com/docs/devguide/selecting_nodes.htm

The only issue will be if you select all four values - then dropdown list will be empty - or contains only value of current news, so you will not be able to change the corner. So you could add some 5th item to dropdown list. Something like position will be changed. This way you would make the corner available.

Best regards,
Ivana Tomanickova