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

comment_expiration_date not working in saef

Development and Programming

Craig Allen's avatar
Craig Allen
135 posts
16 years ago
Craig Allen's avatar Craig Allen

I’m building my first stand-alone edit form.

I’m using the Solspace form helper and the SAEF calendar plugin. And I have TinyMCE WYSIWYG fields, which after much grief finally have working (except for the LG Tiny MCE Image field).

When I embed the exp:weblog:entry_form tag inside the exp:weblog:entries and try to format the comment expiration date using the following code {comment_expiration_date format='%Y-%m-%d %g:%i %A'} it presents the code rather than the data.

What might be causing this?

The form code is as shown below. There are also javascript and css files linked in the header to make TinyMCE and the calendars work.

{exp:weblog:entry_form weblog="forum" return="forum/list" preview="forum/publish"
    show_fields="not forum_body|forum_excerpt|forum_image|forum_image_caption"}
{exp:weblog:entries weblog="forum" limit="1"
    disable="category_fields|member_data|pagination|trackbacks"}

  <input type="hidden" name="entry_id" value="{entry_id}" />
  
  {preview}
    <h1>{title}</h1>
    <h2>Body</h2>
    {forum_body}
    <h2>Excerpt</h2>
    {forum_excerpt}
  {/preview}
  
  <table>
    <tr>
      <td>
      
        Title
        <input type="text" name="title" id="title" value="{title}" size="127" maxlength="127">

         URL Title</span
        
        <input type="text" name="url_title" id='url_title' value="{url_title}" maxlength="75" size="50" />
        
        * Body
        <textarea id="field_id_124" name="field_id_124" dir="ltr" cols="96" rows="10">
          {forum_body}
        </textarea>
        
        Body excerpt
        <textarea id="field_id_125" name="field_id_125" dir="ltr" cols="96" rows="10">
          {forum_excerpt}
        </textarea>
        
        Visibility of this post
        <select name="{exp:form_helper:field_grabber field_name='forum_visibility'}">
          {exp:form_helper:custom_pulldown entry_id="{entry_id}" field_name="forum_visibility"}
          <option value="{value}" {selected}>{value}</option>
          {/exp:form_helper:custom_pulldown}
        </select>

      </td>
    </tr>
    <tr>
      <td valign="top">
        
        {status_menu}
          <div class="saef_float_left">
            Status
            <select name="status">
              {select_options}
            </select>
          </div>
        {/status_menu}

        {category_menu}
          <div class="saef_float_left">
            Categories
            <select name="category[]" size="4" multiple="multiple">
              {select_options}
            </select>
          </div>
        {/category_menu}
        
        <div class="saef_float_left">
          <input class="checkbox" type="checkbox" name="allow_comments" value="y" {allow_comments} />
              <span class="label">Allow Comments</span>
        </div>
        
      </td>
    </tr>
    <tr>
      <td valign="top">
      
        <div class="saef_date">
          Entry Date
          <input type="text" name="entry_date" 
              value="{entry_date format='%Y-%m-%d %g:%i %A'}" 
              maxlength="23" size="24">
          {exp:cal_saef:calendar name="entry_date"}
            {calendar}
            <div class="reset_links">{clear_link} | {today_link}</div>
          {/exp:cal_saef:calendar} 
        </div>
        
        <div class="saef_date">                          
          Expiration Date
          <input type="text" name="expiration_date" 
              value="{expiration_date format='%Y-%m-%d %g:%i %A'}" maxlength="23" size="24">
          {exp:cal_saef:calendar name="expiration_date"}
            {calendar}
            <div class="reset_links">{clear_link} | {today_link}</div>
          {/exp:cal_saef:calendar} 
        </div>
      
      {if member_group =="1"}
        <div class="saef_date">  
          Comment Expiration Date
          <input type="text" name="comment_expiration_date" 
              value="{comment_expiration_date format='%Y-%m-%d %g:%i %A'}" 
              maxlength="23" size="24">
          {exp:cal_saef:calendar name="comment_expiration_date"}
            {calendar}
            <div class="reset_links">{clear_link} | {today_link}</div>
          {/exp:cal_saef:calendar}
        </div>
      {/if}
      
      </td>
    </tr>
    <tr>
      <td valign="top">
      
        <input class="checkbox" type="checkbox" name="dst_enabled" value="y" {dst_enabled} />
          <span class="label">Daylight savings is in effect on date of entry</span>
        
      </td>
    </tr>
    <tr>
      <td valign="top">
        
        
          <input type="submit" name="submit" value="Submit" />
          {!-- <input type="submit" name="preview" value="Preview" /> --}
        
        
      </td>
    </tr>
  </table>

{/exp:weblog:entries}
{/exp:weblog:entry_form}

Moved to Plugins by Moderator

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

Craig, your work flow involves third party addons, so moving this to Plugins for additional community support.

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

Are you sure you should be using format? The docs don’t use them.

Comment Expiration Date 

<input type="text" name="comment_expiration_date" value="{comment_expiration_date}" maxlength="23" size="25" /></p>
       

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.