Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Document-specific variables for web parts View modes: 
User avatar
Member
Member
lancetek - 9/23/2011 9:29:55 AM
   
Document-specific variables for web parts
Hi,
I'd like to know how to make a web part store values against a document versus a template. eg: Usually when you put a web part into a template, any changes to the web part (on that template) are shared by all documents that use the template. But I've noticed that the 'editable text' web part's 'text' property is NOT shared - it's unique per document.

Storing web part data against the template or the document

...In general data can be stored as a part of document or a template...


I can see in the cms_document table, sometimes the documentContent is populated.

Is it possible to store other webpart variables against the document? In my case I'm wanting to store a 'path' variable against the document - so that the editors can explicity choose a path for a repeater per document, instead of per template.

Thanks,
Lance

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/25/2011 3:57:36 AM
   
RE:Document-specific variables for web parts
Hi,

Yes, it is possible. You can take inspiration from the "editable" web parts like statix text/HTML or editable image web part. Your web part can inherit from CMSAbstractEditableWebPart class and you can e.g. override the SaveContent() method.

Best regards,
Juraj Ondrus