I’m new to channel forms. I’m trying to accomplish having a signed in user create a channel entry into a nonprofit channel, then view that entry and make changes to the existing text on the front-end. My question is, how do I pull the existing entry data and update the entry on the front-end? Does anyone have an example I could look at to get an idea? I have been looking through the docs and google and I can not seem to figure this out.
Here is some of my code that collects the user’s information. It works fine creating a new entry id, and storing the information into the Nonprofits channel .
{exp:channel:form channel="Nonprofits" return="Nonprofits/edit/ENTRY_ID" entry_id="{segment_3}"}
<div class="row justifty-content-center">
<div class="col-lg-8 mt-6 mt-lg-0 pt-2">
<form class="mt-4">
<fieldset>
<legend class="fs-3 fw-600 text-center">Nonprofit Information</legend>
<div class="form-group">
<label>Title</label>
<input type="text" name="title" id="title" value="{title}" size="50" maxlength="100" >
</div>
<div class="form-group">
<label> URL Title</label>
<input type="text" name="url_title" id="url_title" value="{url_title}" size="50" maxlength="100">
</div>
<div class="form-group">
<label>Organization Summary</label>
<textarea class="form-control" name="org_summary" value="{org_summary}"type="Expresso" rows="4" cols="50"></textarea>
</div>
<div class="form-group">
<label>Describe Your Organization</label>
<textarea class="form-control" name="describe_your_organization" value="{describe_your_organization}"type="Expresso">
</textarea></div>
Then the user has an option to “edit their profile” by clicking this link Edit your profile
Takes the user to the edit_profile_entries template which has the opening tag: {exp:channel:form channel="Nonprofits" return="Nonprofits/edit/ENTRY_ID" } <main> <section class=”background-white” id=”nonprofits_profile”> <div class=”container”>
<div class="row justifty-content-center">
<div class="col-lg-8 mt-6 mt-lg-0 pt-2">
<form class="mt-4">
<fieldset>
<legend class="fs-3 fw-600 text-center">Nonprofit Information</legend>
<div class="form-group">
<label>Organization Summary</label>
<textarea class="form-control" name="org_summary" value="{org_summary}"type="Expresso" rows="4" cols="50"></textarea>
</div>
<div class="form-group">
<label>Describe Your Organization</label>
<textarea class="form-control" name="describe_your_organization" value="{describe_your_organization}"type="Expresso">
</textarea></div>
<div class="form-group">
<label>Board Member Position</label>
<input class="form-control" name="board_member_position" value="{board_member_position}" type="Expresso">
</div>
<div class="form-group">
<label>Board Term</label>
<input class="form-control" type="text"name="board_term" value="{board_term}" placeholder="eg: 1 year">
<div>
This template only shows the empty fields and not the data the user already has entered. I’m using expression engine v5.4 still. Thanks for any advice
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.