seth_w_jackson
I'm new here

ContentCreator - EasyEdit for Datasources within Page Template

Jump to solution

I'm currently using FirstSpirit Server version: 5.2.212.71463.

I have a page template that has the following generation channel snippet:

$CMS_RENDER(template:"channel_import", type:"tt", uid:"standard.footers")$

This render template essentially will call the generation channel of a any object (in this case a table template), per below:

$CMS_VALUE(#global.userService.getStore(class("de.espirit.firstspirit.access.store.Store$Type").TEMPLATESTORE,false).getStoreElement(uid, class("de.espirit.firstspirit.access.store.IDProvider$UidType").TEMPLATESTORE_SCHEMA).getTemplateDocument(#global.project.templateSets.get(0)))$

Which will call the generation channel of the table template named "standard.footers", whose generation channel is the HTML snippet of the site-wide footer.

This footers table template has markup within the generation channel for EasyEdit, which I've included a snippet below:

$CMS_IF(!#row.isEmpty)$

          $CMS_SET(set_row, #row)$

$CMS_END_IF$

<div class="footer-copyright-row__wrapper">

    <div class="footer-copyright-row clearfix">

        <p$CMS_VALUE(editorId(editorName:"tt_copyright"))$>$CMS_VALUE(set_row.copyright)$</p>

    </div>

</div>

The issue I'm having is that in ContentCreator, the javascript functionality for editing the footer on the page works but gives me an error when trying to edit the datasource.

"Editor 'copyright' not found in Page 'Jared Home Page'!"

I'm at a loss as to what is needed to edit this datasource, as it's embedded in the page template generation channel and not within a separate content area like the Mithras project uses. I'm also a little fuzzy as to how FirstSpirit determines the scope of the editors within the ContentCreator and thus why it can't find the table template editor that is rendered on the page.

Thanks!

Seth Jackson

0 Kudos
1 Solution

Accepted Solutions

Michael,

Ok, that definitely helped me figure this one out. The end solution was that the parent html node for the entire section (a section node instead of a div) needed to be the following:

<section class="site-footer"$CMS_VALUE(editorId(entity:set_row, template:"standard.footers"))$>

This enabled the buttons to edit the datasource that was embedded in the page template.

Thank you for all your help!

Seth

View solution in original post

0 Kudos
4 Replies
mbergmann
Crownpeak employee

Hi Seth,

in general, the editorId() function needs to know what element you want to edit. FirstSpirit enriches the editorId() call by the "current template context" so that you do not have to provide all that information yourself.

In your case, I think the reason for the problem is that you are rendering a table template, but are in reality inside a "page generation context" because you call it from "outside".

So you will have to add some parameters to the editorId() call, I think the following should work:

$CMS_VALUE(editorId(editorName:"tt_copyright", entity:set_row, view:"UID_OF_YOUR_DATASOURCE"))$

or

$CMS_VALUE(editorId(editorName:"tt_copyright", entity:set_row, template:"UID_OF_YOUR_TABLE_TEMPLATE"))$

Michael

Thanks Michael. That really helped. There's only one outstanding issue.

This was the correct fix for the EasyEdit:

<p class="footer-copyright"$CMS_VALUE(editorId(editorName:"tt_copyright", entity:set_row, template:"standard.footers"))$>$CMS_VALUE(set_row.copyright)$</p>

However, the onhover in ContentCreator doesn't present the fancy edit button in the upper-right corner. However, a long click on the copyright will allow inline editing that will save properly.

0 Kudos

Hi Seth,

The editorId(...) containing the editorName parameter ONLY creates the InEdit functionality. To create the "hover frame", you have to use almost the same editorId(...) syntax, just WITHOUT the editorName parameter.

Add it to a surrounding tag (e.g. a <div>) that represents the area to be highlighted by the border.

The editorId calls are completely independant from each other, so if you want both the "hover border" with the upper right hand buttons to open the complete dataset's form AND the InEdit functionality to directly edit single fields, you need BOTH versions (in different html tags): One for the complete form and one for each field you want to offer InEdit for.

Michael

Michael,

Ok, that definitely helped me figure this one out. The end solution was that the parent html node for the entire section (a section node instead of a div) needed to be the following:

<section class="site-footer"$CMS_VALUE(editorId(entity:set_row, template:"standard.footers"))$>

This enabled the buttons to edit the datasource that was embedded in the page template.

Thank you for all your help!

Seth

0 Kudos