website logo
⌘K
Introduction
PORTAL
Agency Whitelabelling
PAGES
Pages - Accessing Page Data
Pagination Layouts
Page Templates
FORMS
CATEGORIES
Filtering WebApps and Modules by Categories
Outputting Categories on WebApp / Module / eCommerce Layouts
Outputting Category Fields in any Location
Category Detail Layouts
FAQ - Categories
COMPANY INFORMATION
Company Information
SITE SEARCH
Site Search
PUBLIC API/ZAPIER
Zapier - Formatting arrays correctly
Public API/Zapier Changelog
MODULES
Module Marketplace
Building Custom Modules
Siteglide Modules
Front-end Submit Modules
DATA STRUCTURES
Creating WebApps from the CLI
Field Types
WEBAPPS
Front-end Submit WebApps
Layouts
Search and Filtering
Understanding Custom Field Names and IDs
FAQ - WebApps
CRM
User Details
User Secure Zones
Storing User's Favourite WebApp / Module Items
User's Form Submissions (Cases)
How Users Edit their Email and Password Front End
Editing a User's CRM record Front End with Custom Field Sets
CLI
Introducing Siteglide CLI
CLI Changelog
Secure Zones with CLI
Page Templates with Siteglide CLI
Pages with Siteglide CLI
Includes with Siteglide CLI
Managing Email Templates
Migrate - Manual Form setup
Migrate - Convert existing Forms
Liquid
Accessing Assets
Liquid Dot Notation
Using WebApp Collections- Tutorial
Using the current_user object with Secure Zones
Preventing Duplicate Content with Query Parameters- Canonical URL and Robots.txt
FAQ - Liquid
GraphQL
Tutorial Overview
About GraphQL
Tutorial 1- Your First Query
Tutorial 2 - Pagination
Tutorial 3 - Filtering the Results
Tutorial 3 - Answers to the First Filtering Challenge
Tutorial 4 - Advanced Filtering
Tutorial 4 - Challenge Answers
Tutorial 5 - Using Liquid to run GraphQL queries on your Site
Tutorial 6 - Variables
Tutorial 6 - Answers to the Variables Challenge
Tutorial 7 - Sorting
Tutorial 8 - Building a Liquid API GET Endpoint Page powered by GraphQL queries
Best Practice and Performance
Module/WebApp Caching
Getting Started with Liquid Caching - to Reduce Server Response time and Improve Performance
Includes
ecommerce/checkout_standard
Frequently Asked Questions
How do I control Timezones?
Using Liquid Logic to Check if a field exists, or is empty on the Front End
How do I learn more about Liquid?
How to setup a multi domain start page
Docs powered by
Archbee
MODULES
Front-end Submit Modules

Modules - Front End Edit

14min

Introduction

If a logged-in visitor to your Site has submitted a Module Item, they can now edit it too.

The Module Creator

Most Modules, including those created by the Admin and those created by visitors who are not logged in will not store the ID of a creator. 

However, any Modules created Front-End by a logged in User will store their creator's ID in the creator field. 

Filtering a Module List by creator

Finding Module Items created by the current user

HTML
|
{% include 'module'
   id: '1'
   layout: 'default'
   type: 'list'
   creator_id: context.current_user.id 
%}


Finding Module Items created by any specific user

In this example we create a variable by hard-coding a specific User ID.

HTML
|
{% assign user_id = '8' %}
{% include 'module'
   id: '1'
   layout: 'default'
   type: 'list'
   creator_id: user_id  
%}


Outputting information about the creator in the Module Layout

You can now access the following fields inside a Module Layout:

  • {{this.creator.id}} 
  • {{this.creator.name}} 
  • {{this.creator.first_name}} 
  • {{this.creator.last_name}}
  • {{this.creator.created_at}} 

Only owners of a Module Item that are logged in can view an Edit Form for that Item.

Find other Module items with the same creator

You could of course combine both of these features- creating a link to the same page including the creator_id as a query parameter and then filtering by that ID using context.params to fetch the ID from the URL.

Syntax for the Edit Form

Including the Form inside a Module Layout

Unlike the "Add" Form, the Front End Module Edit Form must be linked to the specific Module Item it will Edit. This means you can only output the Form inside a Module Detail or List Layout file. 

To include the Edit Form inside a Module Layout, add the Liquid tag: {% include 'module_form_edit', layout: 'default' %} Parameters: 

  • layout - Optional - Choose the name of your Layout file

Important

Even if you include the Liquid Tag, the Form will only display for visitors who are logged in and are registered as that Module's creator.

Developing the Form Layout

The Edit Form will work if you use the same Layout as you used for your add Form.  However, you may wish to use an alternative Layout so you can add some additional features.

Dynamic Fields from the Module

As you're including the Edit Form inside a Module Item, you have access to the Module fields that are inherited from the Module Layout.

One example might be adding a Title to the Form which dynamically references the Module Item: <h3>Edit {[this.name}}</h3> Another example might be displaying the creator's name: <h4>By {[this.creator.name}}</h4>

Pre-filling values 

In a Form Layout, we use the form_builder variable to dynamically add the correct name Attribute to inputs. You can use this to output the pre-filled value; instead of the name property, output the value property. For this example Module field: <input name="{{form_builder.fields.properties.module_field_1_1.name}}"> ...you can use the name field and replace .name with .value to add a value attribute:

HTML
|
<input
       name="{{form_builder.fields.properties.module_field_1_1.name}}" 
       value="{{form_builder.fields.properties.module_field_1_1.value}}"
>




Updated 03 Mar 2023
Did this page help you?
PREVIOUS
Front-end Submit Modules
NEXT
Creating WebApps from the CLI
Docs powered by
Archbee
TABLE OF CONTENTS
Introduction
The Module Creator
Filtering a Module List by creator
Finding Module Items created by the current user
Finding Module Items created by any specific user
Outputting information about the creator in the Module Layout
Find other Module items with the same creator
Syntax for the Edit Form
Including the Form inside a Module Layout
Important
Developing the Form Layout
Dynamic Fields from the Module
Pre-filling values 
Docs powered by
Archbee