Posted on 21/11/2014 10:34:07
Dynamicweb actually contains some hidden gems that can help you edit content from the frontend, but not actually in the frontend.
When a page in rendered and a user is logged in to the Dynamicweb backend, a number of additional template tags containing some useful links for editing the content being rendered are available.
In a page layout template you can use something like this to help users easily edit content in the backend
<fieldset>
<legend>Page actions</legend>
@if (!string.IsNullOrWhiteSpace(GetString("PageEditInBackendUrl")))
{
<a target="backend" href='@GetString("PageEditInBackendUrl")'>Edit page</a>
}
@if (!string.IsNullOrWhiteSpace(GetString("PageParagraphsEditInBackendUrl")))
{
<a target="backend" href='@GetString("PageParagraphsEditInBackendUrl")'>Edit paragraphs</a>
}
@if (!string.IsNullOrWhiteSpace(GetString("PageItemEditInBackendUrl")))
{
<a target="backend" href='@GetString("PageItemEditInBackendUrl")'>Edit item</a>
}
</fieldset>
Similarily in paragraph templates
<fieldset>
<legend>Paragraph actions</legend>
@if (!string.IsNullOrWhiteSpace(GetString("ParagraphEditInBackendUrl")))
{
<a target="backend" href='@GetString("ParagraphEditInBackendUrl")'>Edit paragraph</a>
}
@if (!string.IsNullOrWhiteSpace(GetString("ParagraphEditModuleInBackendUrl")))
{
<a target="backend" href='@GetString("ParagraphEditModuleInBackendUrl")'>Edit module</a>
}
</fieldset>
This is not real frontend editing, but these urls helps solving the basic problem of finding the content that you want to edit, and then lets you edit the content in a familiar interface.
Best regards,
Mikkel