Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
Inline editing works on welcome_message but having issues with enabling within cms:globals. Is this supported, any suggestions are appreciated. :)

Thanks, here is a stripped version of the code.

Code: Select all
<!-- rest of code -->
<div <cms:inline_edit 'welcome_message' />>
    <cms:show welcome_message />
</div>
<cms:show_globals>
    <section>
        <h3 <cms:inline_edit 'message_title' />>
            <cms:show message_title />
        </h3>
        <div <cms:inline_edit 'message_content' />>
            <cms:show message_content />
        </div>
        <!-- rest of code -->
    </section>
</cms:show_globals>
<!-- rest of code -->
The way inline editing tags work, they expect to be placed within the full context of the page the fields being edited belong to.
Normally this happens to be the very page the tags are being used in.

However, when the host template is different from the template of the fields being edited, we do this explicitly by using <cms:pages> tag; this is discussed in the docs (https://docs.couchcms.com/concepts/on-page-editing.html).

The same should apply to the global template. Internally it is just a regular Couch template (except that it gets created automatically by the system) so if we know its name we can use it with <cms:pages>. Please see viewtopic.php?f=5&t=11105&start=60#p33131 on how to get the name.

Assuming the global template's name turns out to be 'test.php__globals', following code should do what you are expecting -
Code: Select all
<cms:pages masterpage='test.php__globals' limit='1'>
    <section>
        <h3 <cms:inline_edit 'message_title' />>
            <cms:show message_title />
        </h3>
        <div <cms:inline_edit 'message_content' />>
            <cms:show message_content />
        </div>
        <!-- rest of code -->
    </section>
</cms:pages>

Hope this helps. Do let me know.
2 posts Page 1 of 1