So you have installed SiteEdit 2009.... what's next? This article contains details on how the basics of SiteEdit 2009 can be implemented in your templates, and then moves on to address additional features such as controlling the publication in which components and pages are edited, making embedded or linked components editable through SiteEdit, and enabling the editing and creation of components that are published as Dynamic Component Presentations. The whole article refers to functionality provided by SiteEdit 2009 SP2. Earlier versions will not necessarily work with the described approaches. The TT72267 hotfix is also required.
SiteEdit 2009 Essentials
Article Sections
The Template Building Blocks mentioned in this article can be downloaded here .
- SiteEdit 2009 Essentials (1) - The Basics
- SiteEdit 2009 Essentials (2) - Blueprint Contexts
- SiteEdit 2009 Essentials (3) - Creation of new content
- SiteEdit 2009 Essentials (4) - Dynamic Component Presentations
- SiteEdit 2009 Essentials (5) - Embedded Components
Creation of new content
SiteEdit offers some features for the creation of new content, which should not be overlooked. The next section describes two of these.
Creation of new content using Page Types
You can create dummy pages in the CMS which are 'cloned' in order to create new pages within your website through SiteEdit. This can vastly simplify the process of creating new pages however before going any further it is worth stressing the following point:
While it is possible for the user to select where they create the new page, the new component is created in a fixed location, that is configurable only on a per-schema basis.
This means, for example that if you make use of a General Content schema to create content for many different sections of your site, all the content will be created in the same folder if you use Page Types to create it. Page Types can be useful, however, when you have a specific schema with narrow usage on a particular section of the site (for example News), in which case it may be OK to have all components created in the same place.
The steps to define a page type are clearly defined in the SiteEdit 2009 Implementation Manual section 1.4 Implementing Page Types.
Below is an example of a working configured NewPageCreation section as described in the Manual.
<NewPageCreation>
<Publication Id="tcm:0-9-1">
<PageTypes LoadFrom="tcm:9-322-4"/>
<Components DefaultLocation="tcm:9-323-2"
DefaultTitle="%P% - %N% (%U% - %D%)">
<BasedOnSchema Id="tcm:9-627-8"
Location="tcm:7-245-2"
Title="_%D% - %P%" />
</Components>
</Publication>
</NewPageCreation>
Note that the component creation location has a different publication to the page creation location. Also note that if you use the previously described method to set the BlueprintingPageContext, the Publication id should match the publication in which the pages are created.
Creation of new content using Component Creation Pages
If you have content that is not placed directly on pages, but published as dynamic component presentations, then it is not suitable to use a Page Type to create the content (as this involves creating a page). In this case you need to create a specific Component Creation page. This process is outlined below and also described in the SiteEdit 2009 Implementation Manual Section 3.3.4 Implementing Component creation on a Web page.
For a given schema, you should first create a dummy Component, which will be used as a basis for creation of new components. New components will be created in the same folder as this component.
Note that this may prove too restrictive to make this approach useable, so before you go further, evaluate whether it is practical to have all components of this type created in the same location. One alternative is to create dummy components and pages for each location you want components created in.
Add default field values to this Component that you want to appear in SiteEdit for the editor to change.
Next create a new Dreamweaver Template, which renders the component fields which you want the user to fill in when creating a new component. To make it clear to the editor, you might want to label each field with the field name or description. Ensure the whole set of fields is wrapped in a tcdl:SiteEditNewComponent tag as in the example below:
<tcdl:SiteEditNewComponent schemaUri="@@SchemaUri@@" folderUri="@@FolderUri@@" defaultContentXml="@@DefaultContentXML@@" defaultMetadataXml="@@DefaultMetadataXML@@">
<h2><tcdl:SiteEditComponentTitle>@@Component.Title@@</tcdl:SiteEditComponentTitle><h2/>
<div class="partners">
<div class="header">
<h3>@@RenderComponentField("Heading",0)@@</h3>
<b>@@RenderComponentField("Country",0)@@<br/>
@@RenderComponentField("City",0)@@</b>
</div>
</div>
</tcdl:SiteEditNewComponent>
Create a new modular Component Template with the following, and link it to the schema you are working with.
- SiteEdit Prepare (in our implementation this is part of Component Template Start Actions)
- SiteEdit Prepare Component Creation
- Your DWT created as above
- Enable SiteEdit 2009
- Enable Inline Editing (in our implementation this is part of Component Template Finish Actions)
The SiteEditPrepare Component Creation TBB pushes the following values into the package:
-
FolderUri - the uri of the folder containing the dummy component - this is where new components will be created. This uri is localized to the publication we are publishing from
-
SourceFolderUri - this is the same as the folder uri, but the context is in the publication in which the dummy component is created - this should be used if it is required to create the components at this level, rather than in the level they are published from.
-
SchemaUri - the uri of the dummy component's schema (in the context of the publication we are publishing from)
-
SourceSchemaUri - same as the above schema uri, but in the context of the publication the dummy component is created in. If you use SourceFolderUri you should use this
-
DefaultContentXML - the XML contained in the content node of the dummy component - this is used to initialize the content in the new component
-
DefaultMetadataXML- the XML contained in the metadata node of the dummy component - this is used to initialize the metadata in the new component
Now create a page using this CT and the Dummy component and publish it to the Staging website.
When editors visit this page they will be able to create new components by editing the dummy values provided and clicking the Save button.
Once created, the component should also be published, this can either be done using the Event system or (much simpler) by instructing the editor to click the Publish Component button after saving.
Outcome and next steps
As well as editing existing content, you can now create new pages and components on the website using SiteEdit including dynamic component presentations. However you may notice that dynamic component presentations are not editable when you visit a page that loads them in. The next section describes how to make DCPs editable