Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > How to design so i don't need 100 templates. 8) View modes: 
User avatar
Member
Member
bill.keenan-ctv - 4/2/2009 9:39:14 AM
   
How to design so i don't need 100 templates. 8)
So we have a number of shows, lets say 10, and each show page is essentially identical.

The problem I have , is that the web parts on the page need to know what show they belong to, and I'm not sure how to set that other than as a property on the part, which would require having ad-hoc templates for each show, which is not good.

I think I could have a 'page editing' parameter, similar to how editable text/editable image work, but I can't find any info about that.

Anyone have any ideas?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 4/7/2009 5:11:48 AM
   
RE:How to design so i don't need 100 templates. 8)
Hi.

Could you pelase describe us the scenario with more details? What should be on the page, which web parts, how it should work, etc. E.g. on some example, so we will be able to provide you with possible settings and configuration or other suggestions. Thank you.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
Monstesr - 4/7/2009 5:13:43 PM
   
RE:How to design so i don't need 100 templates. 8)
Great!

So lets say we have

/shows/showone.aspx
/shows/showtwo.aspx

These pages are identical in design, they have an editable text box and they both have these two web parts which go to an external resource to get some information.

Schedule
Externallink

Both of those web parts know what to do, but they both need the show ID, lets say id 1, and id 2 respectively for those shows.

So how do i tell the schedule and Externallink web parts what the show ID is (1 or 2) , without having to set it as a property on the 'design' page, which would require a separate template for each show.


User avatar
Kentico Support
Kentico Support
kentico_jurajo - 4/8/2009 3:31:14 AM
   
RE:How to design so i don't need 100 templates. 8)
Hi,

The content of editable regions is not shared by default.

In your controls, you can use the DocumentID or NodeID or the GUID of the document which can be received easily from DB, e.g. according to the current alias path.
Another option is to add to the document type used for the shows a new field with ID where the editor will add the ID in a textbox and then you can pass this value to your controls. I hope it makes sense and that I got the right meaning.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
Monstesr - 4/13/2009 9:44:10 AM
   
RE:How to design so i don't need 100 templates. 8)
Thats' an interesting solution.. So I could create a document called ShowID, and add it to the 'shows' page node, then reference that relative path in my web parts..



User avatar
Member
Member
ksabol-guru - 4/14/2009 3:55:40 PM
   
RE:How to design so i don't need 100 templates. 8)
We also had some questions about how to minimize the number of templates used.

Here is our scenario:

Our site uses primarily a layout that includes a 1/3 left column and a 2/3 right column. The 2/3 right column is where most content should be editable; currently let's say we have a page design with 1 title webpart and 1 editable region webpart.

Our question is: What is the best practice for maintaining a limited number of templates while breaking the 1 editable region out into into multiple editable regions with unique wrapper content? Basically, we would like to move content out of the editable region to "lock it down" so that end users don't disrupt it - but as each content zone may have different content in the wrapper, we weren't sure if this meant we would we have to save each of these as new templates?

Thanks!

User avatar
Member
Member
ksabol-guru - 4/14/2009 4:12:01 PM
   
RE:How to design so i don't need 100 templates. 8)
I should have added - my suspicion is that the way to handle this might be to add two editable regions to the page template and then use the Web Part Control IDs to differentiate between the two regions. Once this is done, we could customize some additional configuration properties - such as the wrapper.

But as we understand it, every time you have a different region/custom wrapper, you might have a new separate template, then? If you could either confirm this is correct or help us evolve our understanding of templates, we would appreciate it.

Thanks again!

User avatar
Member
Member
Monstesr - 4/15/2009 4:49:07 PM
   
RE:How to design so i don't need 100 templates. 8)
Yeah, every time you need to make a 'design' change, like add a web part. You need it to be a different template.

Right now I'm thinking about making a 'show configuration' document type, that has all the parameters I need, and putting one in every show directory, then referencing by relative path to get at it....

I don't know, seems a bit cludgy, but there you go.

User avatar
Member
Member
Chris - 4/28/2009 8:24:58 PM
   
RE:How to design so i don't need 100 templates. 8)
Monstesr - another option is to make a "Show" document type that has the option to "Behave as Page" set (bottom of "General" tab for a Document Type).

So, instead of a Page document and a "Show Configuration" document, you have just one "Show" document that is both a page and can hold the parameters/configuration for the show in custom fields.

If you already have a bunch of pages, your problem is you have to convert the Document Type from a "Page" to a "Show" - and I don't see any built in functionality for doing that.

But if you're still architecting the structure, now would be a good time to create such a Document Type.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 4/16/2009 3:53:02 AM
   
RE:How to design so i don't need 100 templates. 8)
Hi,
I am not sure if I understand your need correctly.
But in general - the content of editable text web part is stored to document - so each document with the same template has different text.
The static text web part stores the content to the template - so you can place this web part on the template, add text and this text will be the same on all documents using this template.

If you want to have unique text on each page, you can use the static html/text web part and into its content place macro expression. For example macro for document name - so on each document will be the current document name displayed.
I hope it makes sense.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
ksabol-guru - 4/16/2009 7:27:50 AM
   
RE:How to design so i don't need 100 templates. 8)
Thanks, Juraj - I don't believe we have tried working with macros yet - we'll give that a shot and let you know!