Home
TeamSite
Example of in-context-edit a DCR
Mihir
I am trying to display a DCR using the DCR Datum in a component. I want to enable in-context-edit on the fields, but can't seem to figure it out. The documentation doesn't have any examples on how to do this with a DCR Datum...
Find more posts tagged with
Comments
miroperez
For a dcr you have to wrap the field with a special span. For example, if you were displaying a dcr before like this :
<xsl:value-of select="item[
@name=
'Title']/value"/ ><!--taken from Book Form Entry Component -->
You need to modify it to be:
<span in-context-edit="{/Properties/Data/Datum[
@Name=
'Book XML File']/
@ID}"
dcr-item-paths="/Title" >
<xsl:value-of select="item[
@name=
'Title']/value"/>
</span>
where the in-context-edit attribute contains the xpath to the ID of your datum:
<Data>
<Datum ID="D01" Name="Book XML File" Type="DCR">
<DCR Category="internet" Type="book"/>
</Datum>
</Data>
and the dct-item-paths attribute is the forms pub path to the item you want to edit in context.
miroperez
Also, note. The path in the dcr-item-paths is the formspub api xpath not the save dcr xml xpath. Any element with a name attribute would be included in the formspub api xpath including tab elements.
vijay_arora
Hi
i'm getting error in the same.....
"You cannot edit this content.
Suggestion: Inform your component developer that this is an unsupported property type for in-context editing."
Any idea...........
miroperez
What type of control are you trying to in context edit? Based on the message, it doesn't sound like it's a dcr type. The only datum types supported for in context editing are: TextArea, String, Number and DCR.
vijay_arora
Hi
Below is related code:
Apperence XSL code:
[HTML]
[/HTML]
Apperence XML code:
[HTML]
[/HTML]
DCR Content:
[HTML]
Teamsite World
[/HTML]
I have tried all the permutations for dcr-item-paths attribute in in-context span tag. But i am getting same error everytime.
Does LS2.2.1 supports in-context-edit for DCR Datums? Can anyone helps me on this.
tec_iwov
in context edit for DCR was added in 3.0 Sorry
Brittany
Im using LS 3.1 and Im having a problem with in context editing with DCRs. Attached is an example of my code :
But when i try and edit the component in a page in the in context edit mode i have a problems. A box will show as if its going to allow me to edit something but the box is blank. No elements to edit. So what am i doing wrong?
miroperez
My first thought would be is the dcr-item-path correct? What does your dct look like?
Brittany
My DCT is pretty much one of the OOB ones. But I've attached it
miroperez
Brittany,
It needs to be the formapi item path not the xml path to the element.
It should be:
dcr-item-paths= "/Content/PromoCode"
liv2luv
Follow this simple procedure.
1. Create a DCR file with some example text in your DCR
2. Note the xpath with item paths only from the DCR XML file
Using the DCT it will not be an easy task to locate the item-paths.
Hope it helps
Brittany
Thanks guys the problem was that I needed the leading backslash. Thanks for the help