We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

(Possible Bug) Title Field will not display within Channel Form.

How Do I?

hypatia's avatar
hypatia
8 posts
10 years ago
hypatia's avatar hypatia

I wanted to post here before reporting this as a bug. Running EE 2.9.3. I thought there was a chance someone had encountered this before, and that there was at least some chance I was missing something. Seems like outputting the title of an entry would be incredibly standard so a big part of me thinks I’m just overlooking something.

Title says it all really; if I place a EE channel loop within a Channel Form tag pair, the title and url_title of the channel entry will not display. The entry_id displays fine and I added a test custom text field and that also displayed fine.

I’m using the channel loop to populate a Playa select input on the front end. As of right now I had to use an embed to populate the select options. Lame. Here’s some code I ran on a blank template (code is representative of the entire template):

{exp:channel:form channel="production-customers" id="customerInfo" include_jquery="no"}

{!-- The entry_id outputs fine within the Channel Form, but the title is blank. 
Tested url_title as well, also blank. Tested with dynamic="no" as well, 
no difference. --}

<select class="form-control m-bot15" name="customer_sales_rep[selections][]">
 <option value="index">Sales Rep</option>
 {exp:channel:entries channel="production-sales-reps"}
 <option value="{entry_id}">{title}</option>
 {/exp:channel:entries}
</select>

{/exp:channel:form}

{!-- The below outputs as you would expect. --}

<select class="form-control m-bot15" name="customer_sales_rep[selections][]">
 <option value="index">Sales Rep</option>
 {exp:channel:entries channel="production-sales-reps"}
 <option value="{entry_id}">{title}</option>
 {/exp:channel:entries}
</select>

Any thoughts would be helpful. If this is a bug I’ll be happy to report it. I just wanted to confirm I’m not being dense first. I’ve been working with EE for several years but don’t have a ton of experience with Channel Form.

Thanks

       
hypatia's avatar
hypatia
8 posts
10 years ago
hypatia's avatar hypatia

OK, after working with Channel Form a bit more, I realize this isn’t a bug. The behavior is due to the fact that the title tag can be used within the Channel Form tag pair when editing an entry. So I assume EE gives Channel Form precedence over the Channel Entries tag pair. That makes sense when considering the need to edit Channel Form entries.

So I suppose my question then becomes; is there any way to access the Channel Entries title tag within a Channel Form tag pair without using an embed? Something like:

{channel_name:title}

If not I’ll just have to use embeds, not the end of the world.

Thanks

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.