Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Article Display (and Add/Edit) View modes: 
User avatar
Member
Member
Chanan - 2/3/2011 12:11:44 PM
   
Article Display (and Add/Edit)
Our site has a complex article wiki. This Article datatype has several more sections inside it than the default one that comes with Kentico. The display of which might is also more complex and would be hard to do it in one transform. I figured I can set the datatype as "Act as page (Not sure if this is really needed) and setup my page using webparts to display the page. Further, it will have several sub types that will appear under it such as References which I plan to implement as another sub datatype.

My thought was to create an add/edit page that will use a custom webpart to create the needed page when an article is created (Copying the Group Registration webpart as my reference).

I have a few questions:
1. Does this approach make sense?
2. In the Admin there is a place for Add & Edit pages in the datatype screen but I cannot find documentation of what exactly they do and how to use them. Are they useful in this case? If so, how are they used?
3. I see how to use a repeater on a parent page to show a list of children and then transform them. I don't see an example of how to show data from the current "Form" tab onto the design page. Which webparts should be used?

Thanks,
Chanan

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 2/9/2011 6:41:31 AM
   
RE:Article Display (and Add/Edit)
Hi,

Could you please provide more details about your wiki design?

A) How should the content tree structure of your wiki section look like? Please provide some example. It will help us imagine the complexity of the design. Please add some note about document type of listed documents and its relationship.

B) How should documents be displayed? Some screenshot may be useful.

I think there will be some easier solution as you described. But I need to know more details. Maybe you will need to slightly modify user contribution and edit contribution webpart - with this modification the new document will be added into selected category (parent). This category will be choosen by contributor. You will not be limited by settings of webpart. Then set up the repeater webpart would be easier.

Thank you for information.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
Chanan - 2/10/2011 6:03:26 AM
   
RE:Article Display (and Add/Edit)
Ok, let me rephrase the question. Is there a way to have two separate physical pages for the repeater part and the item page?

As the the examples are show now, you place a repeater and set the preview and default transformation. That usually works well, but in two cases it might not:

1. Biggest one - you may want to have a different layout for the listing page and the page itself.

2. Smaller issue, but it was the one I tried to explain in my original post - The Wiki may contain many datatypes and also sub types So in may case an article (which can be on of many types) can contain references and citation that we want to store as separate datatypes. While all this is still possible using that one page approach - it makes for a very messy and confusing page. It would be cleaner to have one page to list the articles, one to display the articles and its sub type and one for the each sub type.

I saw that each item is already a page and I can apply a template to them, I understand that in the preview transform I can use GetDocumentUrl to link to that item. What I don't see is a way (webpart) to say: In this location output the title of the current item, and here place the body, etc.

I hope that explains my issue. :)

User avatar
Member
Member
dima - 2/10/2011 7:29:37 AM
   
RE:Article Display (and Add/Edit)
when you create a new database item - i.e. product - you can see a new document appeared in the document tree. you can go to the properties of the newly created document and specify a different template which can be an ad-hoc one or if you wish you can reuse that template for other documents of the same type. just make sure that the template selected for the item is different from the one selected for the listing page.

User avatar
Member
Member
Chanan - 2/10/2011 8:09:03 AM
   
RE:Article Display (and Add/Edit)
Yes, I understood that, although that brings up the question of how will the template be specified when added from the wiki.

However, what I don't understand is how to display data for that document. All the examples show using the default transform coming from a repeater. There is no example of how to grab data from the current item's fields directly.

User avatar
Member
Member
dima - 2/10/2011 8:19:07 AM
   
RE:Article Display (and Add/Edit)
What I don't see is a way (webpart) to say: In this location output the title of the current item, and here place the body, etc.


Is that your main problem? If so - I don't see why you don't want to use transformations? Because that's exactly what they are for.
Even if you want to have different transformation applied for different article types then you can use macro expression to specify transformation names.

User avatar
Member
Member
Chanan - 2/16/2011 6:07:10 AM
   
RE:Article Display (and Add/Edit)
I can use transformation, but I think there are cases where it would be preferable to have an actual page per datatype for three reasons:

1. In our cases we have a datatype - Article and a few sub datatype: References, Resources, Citations, etc. It seems to me (unless I am doing something wrong which could be) that you would have define all the repeaters for all those types on the top level page and use the filter to them out based on Menu Item and Article. Where it would make more sense to have just the article repeater on the main page and the other repeaters on the article template.

2. "Hiding" the design in the Transformation does not allow for us to give access to teh design tab to a Web Designer to go in and adjust the template. A developer would be required to do that.

3. Transformations although a very powerful concept do limit you to one area of the page. So for example, I cannot place data elements of the current document outside of the repeater. (Ok, maybe with very complex javascript and CSS, but that isn't something I would like to try to get right...).

However, I did notice the patch today mention a control called: CMSDocumentValue which does seem to be the control I was looking for. Hopefully, it can output datatype data as well as the node and document data that it shows in the example.

User avatar
Member
Member
Chanan - 2/16/2011 6:13:25 AM
   
RE:Article Display (and Add/Edit)
I should point out though that the control CMSDocumentValue isn't a webpart, but I can expose it of course as a webpart - I think though that Kentico should supply an equivalent webpart out of the box.

User avatar
Member
Member
dima - 2/17/2011 1:55:13 AM
   
RE:Article Display (and Add/Edit)
You can have a specific page template for each of the datatypes you have in the system. Also you can a user to select which template to use when adding a document of specific datatype.
If you want to place data elements in different places of the page you still can add several repeaters in different places of the page and select transformations for them that would display different fields of the document.

User avatar
Member
Member
Chanan - 2/17/2011 5:59:32 AM
   
RE:Article Display (and Add/Edit)
Hi Dima,

Thanks for your response! Can you elaborate on how you would approach those issues. Here is what I found out:

First problem - page template for the datatypes instead of using default transform in the repeater - Haven't found a good way to do this yet. I could expose the CMSDocumentValue as a webpart - if it can show data from the datatype and not just the nodes and document table. Another way I suppose it could be done is have a repeater and just fill in the defalut transform. That may work as well.

Second problem - Replace the Add/Edit pages - I see two ways. One is to use the Alternative Form section, although that is easy to do it may not accomplish all that we would like to do. The second is to write a web part from scratch that would insert a node and datatype into the tree and set all the needed values.

Have you other ways to solve one of those?

As a side note, it would be nice if Kentico had fields (or reuse the ones that exist) to replace the view,Add,Edit,Preview,List not only in the CMSDesk, but for the live site as well.

Chanan

User avatar
Member
Member
dima - 2/17/2011 8:39:00 AM
   
RE:Article Display (and Add/Edit)
Hi Chanan,

First problem.
I have three document types each of which has its own template. When I was creating a first document I used an empty page layout, then placed relevant web parts and saved it all as a new template that I used when I was creating other documents of the same types. I really think you don't have to create a CMSDocumentValue web part unless you really want to. You can create a transformation just to display one single field. So you would be able to place as many repeaters on the page as you need and select a needed transformation depending on which field you want to show. That would be a way instead of creating a new web part.

Second problem. I would probably do my own webpart in this case if you are really concerned that you may come across some lack of functionality in the core version of Alternative Forms.

Dima

User avatar
Member
Member
Chanan - 2/18/2011 6:45:12 AM
   
RE:Article Display (and Add/Edit)
Hi Dima,

Thanks, at first I didnt think of using the Repeater to show one field because it doesn't seem natural, but I understand now.

We create an alternative form and replace it with a webpart when it is done.

Thanks Dima, you have been very helpful.