Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7859703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:59:57+00:00 2026-06-02T21:59:57+00:00

I have a template called post.html in group.group. The template includes a safecracker form.

  • 0

I have a template called post.html in group.group. The template includes a safecracker form. I have the safecracker form inside and if/else statement so that if the url is /group/post/title then the safecracker form loads an existing entry for editing. If there is no title segment (url is only /group/post) then it loads a blank safecracker form to create a new post. Here’s my code:

{if segment_3 != ""}
      {exp:safecracker channel="trophy_gallery"
       require_entry="yes" url_title="{segment_3}" author_only="yes"}

            // edit entry form code

        {/exp:safecracker}
{if:else}
        {exp:safecracker channel="trophy_gallery"}

           // create entry form code

        {/exp:safecracker}
{/if} 

For some reason the safecracker settings like require_entry, url_title and author_only are effecting the safecracker setup in the “else” block of the code. So when I load a url without a third segment it’s telling me no entry was provided.

Is there something wrong with the way I’m formatting this (a better way to do so), or is this potentially a bug in how the safecracker tags are being parsed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T21:59:58+00:00Added an answer on June 2, 2026 at 9:59 pm

    Here’s the answer from the Expression Engine forums:

    The Safecracker tag already has built in parsing to handle the edit/new situation based on the value of url_title or entry_id. So I could rewrite my code as:

    {exp:safecracker channel="trophy_gallery"
     url_title="{segment_3}" author_only="yes"}
    
        // edit entry form code
    
    {/exp:safecracker}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view and template called index.html. I have a image which is
I have found in sfDoctrineApplyPlugin a template called applyAfter.php that shows a message like
I have the following use case: There's a class called Template and with that
I've generated the following XSLT file, and have created a Form that will post
My issue involves jQuery .post and Joomla. I have a template with a form
I have a _form.html.erb partial that comes from the standard rails 3 template for
i have a template url called /monsters. and in the template, i have a
i have template base.html and some children templates. I don't know how to set
I have template that looks like this: 100 template<size_t A0, size_t A1, size_t A2,
I have a 'template' system in my CMS rails app. Basically the whole HTML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.