In SDL Tridion 2009 SP1 we have Components that are added to Structure Group and Page Metadata which are then output on the Page as a Component Presentation. We have done this to allow users to set global content per site section without the need to add it to every single Page in the Structure Group.
When we output the Component with a Component Template with manual tags we get a red box around the Presentation and the tooltip of the SiteEdit box says “Removed”. When using the exact same Component Template in the Component Presentations tab and rendering that on the page the content is editable.
Is it possible using SiteEdit 2009 to inline edit a component added as Page/Structure Group metadata?
Note: We are aware of an outstanding bug in SDL Tridion 2009 SP1 that when you go to open a component added to Page/Structure Group metadata that it always opens it read-only. Could this be causing the issue?
It is possible to do this but you have to make sure that your markup is correct. I have done this before by marking the SiteEdit Component Presentation as QueryBased which seems to make SiteEdit ignore it's usual rules where the Component must be added in the Component Presentation list
<!-- Start SiteEdit Component Presentation: {
"ID" : "CP1",
"ComponentID" : tcm:32-204298",
"ComponentTemplateID" : "tcm:32-204519-32",
"Version" : "16",
"IsQueryBased" : true}
-->
You need to either:
Expose the metadata of the page in a "visible" area of your page with the correct SE markup
Open the page in CME and edit the Metadata there.
Tridion UI 2012 added a button with "Edit Metadata" functionality, but that's not available for SE 2009
Not through inline editing. You can of course open the Page editing popup and edit the metadata there.
Of course if you want to edit fields of the Component that you've linked in Page Metadata, you can just render out that Component Presentation into the HTML and mark it with the correct SiteEdit commands as Nuno suggests.
Related
I'm having a problem enabling multimedia components i.e. image components to be edited through Tridion UI. When I use a General Content Component that has an image field it works fine without any issues as I get the JSON objects below:
<!-- Start Component Presentation: { 'ComponentID' : 'tcm:15-5444', 'ComponentModified' : '2012-12-27T12:07:29', 'ComponentTemplateID' : 'tcm:15-5364-32', 'ComponentTemplateModified' : '2012-12-27T11:30:49' } -->
<div><!-- Start Component Field: {'XPath' : 'tcm:Content/custom:Content/custom:image[1]'} --><img src="/Preview/_images/15-5366Hero%20Banner.jpg" alt="Banner SE"></div>
However When using an Image Schema Component directly with a Component Template the following tags are output:
<!-- Start Component Presentation: { 'ComponentID' : 'tcm:15-5366', 'ComponentModified' : '2012-12-18T13:21:46', 'ComponentTemplateID' : 'tcm:15-5364-32', 'ComponentTemplateModified' : '2012-12-27T11:30:49' } -->
<div><!-- Start Component Field: {'XPath' : 'tcm:Content/custom:Content/custom:Component.ID[1]'} --><img src="/_images/15-5366Hero%20Banner.jpg" alt="Banner SE"></div>
I know that I may not need to use "custom:Component" as this doesn't exist in the XML but can you see what I am doing wrong? Has anybody had any experience using a Multimedia Component directly on a page and been able to have the left hand image selection sidebar display?
Regards,
Billy
The markup you pasted is about inline editing of Component fields.
You can't use it for anything else.
You can inline edit the Metadata fields of an image Component in the Tridion UI, but you cannot upload a new version of the image. For that you will need use Open in Form View.
To get the Library Panel in Experience Manager (XPM), from the Home tab select Insert Content > Insert Content to get access to the left-hand images.
Your images' multimedia schema needs to have an associated Component Template (this is set in the Component Template's Linked Schema). Though you seem okay since you have the image as a Component Presentation already.
At least on my VM, the thumbnails appear automatically.
Is it possible to call the SiteEdit editable content script to output the content from TBB using RenderComponentPresentation method?
Currently, I am getting a red border line wrapped that content. When I roll over the top right corner icon, it is saying removed. However, the component content is not removed, any changes of the component template or page all have been republished and component itself is also not dynamic component.
The SiteEdit is working if I am calling the editable script directly from TBB, but if I am using RenderComponentPresentation method to call another Component Template to output that script. I only get the red border line and saying it has been removed.
Editable script: (working directly from TBB)
<!-- TemplateBeginIf cond="Content != ''" -->
<tcdl:ComponentField name="Content">${Content}</tcdl:ComponentField>
<!-- TemplateEndIf -->
Within TBB calling below method and always getting a red border RenderComponentPresentation(ComponentID, ComponentTemplateID)
Environment: Tridion 2011, SiteEdit 2009 SP3, Windows Server 2008
I guess this is not feasible with RenderComponentPresentation since what you're trying to do is nested component presentations. However you can get this by adding the siteedit markup tags directly with IsQueryBased to true
Please check the link for additional info (bottom of the section): http://sdllivecontent.sdl.com/LiveContent/content/en-US/SiteEdit_2009_SP3/concept_0D0C929C17D74A6292B2AFE0C29F4DCD
Alternative approach is to add the below markup before your nested component presentation (IsQueryBased should be true):
<!-- Start SiteEdit Component Presentation: {
"ID" : "MyCP23", "ComponentID" : "tcm:54-7894",
"ComponentTemplateID" : "tcm:54-3201-32",
"ComponentVersion" : 2,
"IsQueryBased" : true,
"SwapLabel" : "Left"
} -->
If you are rendering a Component which is not on the current Page, then it is to be expected that SiteEdit considers it removed.
You will need to mark the Component Presentation as "query based" so SiteEdit knows not to expect it on the Page. This will disable the functionality which doesn't make sense (such as drag-and-drop to move the CP around on the Page) but will otherwise work the same.
To mark it as query-based, you will need to manually output the markup (see Start SiteEdit Component Presentation command) or use some other tool to do it for you, like the functions created by Frank van Puffelen (note: I believe these only work for the 2011 version). Make sure the IsQueryBased parameter is set to true.
I am new to Tridion and am facing an issue with the taxonomy.
As storage we are using file system and for taxonomy we have sql db.
Now, we have created State as Category with few keywords inside it. I have created schema and a component and have selected one of the keyword for classification. This associates the keyword with the component.
Now I have used the Tridion control with the uri of the State to retreive the taxonomy. It works fine, but the component count is showing as (0) instead of (1) since only one component is added in the bracket which is the normal behavior of tridion. I have published the taxonomy as well as the component.
You need to publish the Component that is using the Keyword. As far as I can see, the control is counting items on the Content Delivery side; not items in the Content Manager. I set up a simple example using the basic tag:
<tridion:TaxonomyControl
ID="taxBasicProperties"
TaxonomyURI="tcm:1-8-512"
runat="server">
</tridion:TaxonomyControl>
Result without the component published:
Sistema operativo (0)Android (0)iOS (0)Windows (0)
Result WITH component published:
Sistema operativo (1)Android (0)iOS (0)Windows (1)
Can anyone direct me on how to use SiteEdit specific syntax or tags in the Razor template in DD4T code? I have seen Site Edit related classes in it, but could not understand how to use SiteEdit tags in the view where there were some syntax similar to Dreamweaver for example RenderComponentField or tcdl:ComponentField which we used in Dreamweaver. I am very new to DD4T and am using SiteEdit 2009 SP3 and SDL Tridon 2011 SP1.
Thanks in advance.
Update: We have tried the implementation mentioned in the answer but unfortunately we are getting an error when we are accessing the page in proxy stating "Invalid template -The HTML is invalid, probably because your template code produces invalid HTML, such as a p tag inside another p tag. Check your HTML using a validator such as the W3C Markup Validation Service, correct your template, and republish."
I guess this is because Xml content is being pushed into html page due to the use of Dynamic Page and Component TBBs which we used in our Component and Page Templates.
Let us kow how to continue further.
The SiteEdit markup is not generated like it is done in a Dreamweaver Template, you are responsible yourself to place the markup for your editable fields in the Razor view. Good thing for this is that it works for similar for SiteEdit 2009 SP3 and UI 2012. Downside for UI 2012 is that it is not listening (yet) to the Enable Inline Editing which you can set on the Component or Page Templates (something we should consider for a future DD4T version).
Everything is based on the DD4T SiteEditHelper class. You start in your page view (before the </body> tag) by placing the following call:
#Html.SiteEditPage(Model)
This will write out the page markup, and if you set the style to "SiteEdit2012" in your SiteEdit_config.xml it will also write out the bootstrap script required for UI 2012.
Then for every Component Presentation and every editable Component Field you will also need to add the appropriate markup. For a Component presentation you can use:
#{var ComponentPresentation = ViewBag.ComponentPresentation as IComponentPresentation;}
<div>
#Html.SiteEditComponentPresentation(ComponentPresentation)
</div>
Make sure you write this out inside a DIV or some other element that can mark the boundary of your Component Presentation. For Component Fields a similar story, you can use:
<div>
#Html.SiteEditField(Model, Model.Fields["FieldName"])
#Model.Fields["FieldName"].Value
</div>
Apart from the changes to your views, as Bart has described, you also need to put a configuration file in the root of your web application, called SiteEdit_config.xml. It should look like this:
<?xml version="1.0" encoding="utf-8" ?>
<siteEdit enabled="true" tridionHostUrl="http://tridion.my.com">
<contextPublications>
<contextPublication id="10" componentPublication="3" pagePublication="9" publishPublication="10" />
<contextPublication id="11" componentPublication="3" pagePublication="9" publishPublication="11" />
</contextPublications>
</siteEdit>
You must list all your active publications here. DD4T tries to match your current page to the correct context publication (based on the 'id' attribute). If it cannot find it, SiteEdit will be disabled. The other attributes allow you to control the behaviour of SiteEdit.
componentPublication: new components will be created here
pagePublication: new pages will be created here (not used in Tridion UI 2012)
publishPublication: pages and components will be republished from this context (usually coincides with the id)
DD4T can also easily be configured for use with Tridion UI 2012. Just change the first element in the configuration as follows:
<?xml version="1.0" encoding="utf-8" ?>
<siteEdit enabled="true" style="SiteEdit2012" tridionHostUrl="http://tridion.my.com">
...
</siteEdit>
I have a schema containing a multi-value field of type component link.
How can I render this field (component link with its template) when I write a DWT TBB for this component?
A Component Link field links to a Component - it does not specify a template. So I'll assume you want to specify the Component Template to use on the DWT.
<!-- TemplateBeginRepeat name="Component.Fields.YourComponentLinkFieldName" -->
#RenderComponentPresentation(Field, "tcm:1-2-32")##
<!-- TemplateEndRepeat -->
So this loops over all values of the multi-value field names YourComponentLinkFieldName and render the Component linked in there with Component Template tcm:1-2-32.
All of these topics are relevant to your question:
Retrieving values of a linked component in Dreamweaver TBB - and making it SiteEditable
How to handle nested repeating regions in Dreamweaver TBBs in SDL Tridion 2011 SP1
Retrieving values of a linked component in Dreamweaver TBB - and making it SiteEditable
I suggest you read them and apply your understanding of them.