Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > One editable HTML area on more than one template View modes: 
User avatar
Member
Member
jamxi - 3/8/2010 8:48:23 PM
   
One editable HTML area on more than one template
What I'd like to do is create an editable HTML area that can be edited from inside the CMS desk. This HTML area is to be used on several templates. What's the best way to go about creating this? My first attempt was to create an HTML web part, but I couldn't find a way to take the web part with the existing HTML and add it to other templates.

User avatar
Kentico Support
Kentico Support
kentico_radekm - 3/9/2010 9:14:39 AM
   
RE:One editable HTML area on more than one template
Hello.

Maybe I missing something, but why don´t you use EditableText web part and set "Editable region type" to HTML Editor? Using this web part, you can use CKEditor and html code in it. You can also use / inherit this web part on other pages using the same page template or Visual inheritance feature. The content of this web part is binded to document, not template, so you can have a different content on several pages based on the same page template.

Best Regards,
Radek Macalik

User avatar
Member
Member
jamxi - 3/9/2010 6:08:07 PM
   
RE:One editable HTML area on more than one template
I'm not sure if we're talking about the same thing. I want the same editable html block to be added to several templates. I want to be able to easily update the html block once and still have it appear on the other templates. Can you explain a little more in detail how I'd go about this?

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 3/11/2010 6:51:33 AM
   
RE:One editable HTML area on more than one template
Hello,

In this case, you could place the Static HTML web part on master page and then manage its visibility. You can insert a macro into the Visible property of any web part if you click on the black arrow before the check box. You could for example use the custom macro and return true or false according the context values. Please see here: http://devnet.kentico.com/docs/devguide/appendix_a___macro_expressions.htm for more details about custom macros.

Best regards,
Helena Grulichova

User avatar
Member
Member
jamxi - 3/15/2010 5:13:47 PM
   
RE:One editable HTML area on more than one template
I think I'm still missing something. Here's a better visual representation of what I'm trying to do. The Master page is setup with logo and nav. Then theres currently two templates one for the Home Page and one for the Internal design. I added a zone for the CTA and placed a static html Web part there. Now I'd like to use that same HTML Web part on the Interal Template which has a different layout. So how do I add that same HTML Web part to the internal template.

Home
User image

Internal
User image

User avatar
Member
Member
Elijah - 3/15/2010 8:33:24 PM
   
RE:One editable HTML area on more than one template
I think you might get some use out of making a custom document type and using a one-record repeater to display the HTML.

Make a new doc type and call it "Shared Content"

Add field:
- Content (long text - html editor)

Then put your shared blocks in a folder of their own and manage them separately from the rest of the content using the Form tab for the document.

To use them, insert a repeater web part on the template you're working on and choose your Shared Content doc type, and select the exact doc you want to use in the Path property. That'll ensure only that one gets listed. Then set the transformation to a very simple one like the following:

<%#Eval("Content")%>


I had this problem a while ago so I programmed a custom web part to allow me to select from a list to very easily include shared html content on any template. Video here:
http://www.youtube.com/watch?v=IfSVIf72u7g

User avatar
Member
Member
jamxi - 3/15/2010 10:49:20 PM
   
RE:One editable HTML area on more than one template
Elijah,

I made the doctype like your youtube example. Then created the doc with some generic content and put it in a folder. Then added a repeater to the zone (I have several repeaters to choose from so I assume I should choose the one that just says repeater as opposed to basic repeater or the others). I selected my doctype from Show for document types:. Then selected the path to the doc in the folder.

As far as setting the transition I wasn't quite sure how to set that up. Pasting the code into the translation input box didn't seem right. So I went back to edit the document type adding a new translation with the Eval code (Not sure if thats what I was supposed to do). Then I went back to my repeater and selected that newly created translation. That seemed to save OK, but I evidently am doing something wrong nothing appears in Design view or when I view the live page. Any thoughts?

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 3/16/2010 7:55:18 AM
   
RE:One editable HTML area on more than one template
Hello,

please note that the Selected item transformation should be the same like Transformation in this case. Also please check if you have correct values for:
Path
Document types

The repeater documentation is here: http://devnet.kentico.com/docs/webparts/KenticoCMS_WebParts.htm#_ef79e09b-cbf7-4102-a067-b114b5198d8d


However, I would recommend you to study the Tutorial: http://devnet.kentico.com/downloads/KenticoCMS_Tutorial.pdf to understand what you are doing.


Best regards,
Helena Grulichova

User avatar
Member
Member
jamxi - 3/16/2010 9:15:19 AM
   
RE:One editable HTML area on more than one template
I double checked the Path and Document types and applied the transformation to the selected item transformation and still nothing displays. I'm wondering if somethings wrong with my newley created Doc type. When I select the new document type and choose design or page view the text I saved in there doesn't display should it?

User avatar
Member
Member
jamxi - 3/16/2010 4:06:19 PM
   
RE:One editable HTML area on more than one template
Looks like I finally got this figured out. It looks like even though I had unchecked to not include sub documents for the path it was still looking under the document. I think I'm good to go now. Thanks for everyones help.