Skip Navigation

[Resolved] Wrong page template after submitting new entry by frontend form

This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by Dietrich 6 years, 3 months ago.

Assisted by: Waqar.

Author
Posts
#1127381

Hello,
I have the following problem with the frontend forms.
If a logged in user publishes a new content (for a custom type) via the form, it will be displayed but in the wrong layout. The basic layout is correct, but it is e.g. the default sidebar appears even though it's actually disabled for this page type.
If I then go to the backend and the user there newly created contribution just save again (without doing anything else) everything is correct.
Also in the list overview the new post does not appear until it is saved again.

Here is the form:
hidden link

And here is a post, how it should look like:
hidden link

And here is the post as it looks after entering the form:
hidden link

#1127443

Hi Dietrich,

Thank you for contacting us and I'll be happy to assist.

Based on what you've shared and from looking into the settings of the two "Jobs" posts you've mentioned, it seems your theme ( The7 ) only applies/saves layout settings correctly, once the "Publish" button has been clicked on the post's edit screen.

The use of "save_post" action ( https://codex.wordpress.org/Plugin_API/Action_Reference/save_post ), would explain this limitation. To confirm this, you can also try to add a post programmatically using either custom code ( https://developer.wordpress.org/reference/functions/wp_insert_post/ ) or through any third-party plugin (other than Toolset) and see if the "no sidebar" layout is applied to it, without clicking the "Publish" button.

Since the layout/sidebar settings are being controlled by the theme itself, I'll recommend getting in touch with the theme's official support team, to get the most accurate information about how to overcome this.

I hope this helps! Please let me know if you need any further assistance.

regards,
Waqar

#1127467

Hi,
thanks for your fast answer. I contact the the7 support, unfortunately they are not very helpful...

I have an additional question to the form at hidden link :
in the form there are (at the bottom) two links to other custom types ("Standort Addresse" and "Ansprechpartner"). The user can select one from the list, but how can he create a new entry in the list?
Is there a possibility to create a new "Standort Addresse" under this button where you can make a new entry in a second form (which opens up underneath) and select it?

New threads created by Waqar and linked to this one are listed below:

https://toolset.com/forums/topic/split-additional-form-for-new-custom-post-types/

#1127519

Hi again,

i have one ad on to my first problem:
The new posting is also not in the list view: hidden link
the sidebar is one problem and maybe one problem with the theme. But why it is not in the list?!

#1128035

Hi Dietrich,

Thanks for writing back.

It's our support policy to only address one issue/question per ticket ( https://toolset.com/toolset-support-policy/ ). I have separated the question about the forms to add new custom post type entries and will reply to that in a new ticket.

I've checked the view at hidden link and it is showing all the 8 published "Jobs".

Screenshot front-end: hidden link
Screenshot back-end: hidden link

Note: the post "testjob 1" is showing as the last post on page 3 ( hidden link ), because the view is set to show them by post's published date, in "descending" order.

If I can be of any further assistance, please let me know.

regards,
Waqar

#1128039

Hi,
ok thanks for moving the second question to another tickt, my fault.

The entry published by the form is not showing in the list.
This was the entry; hidden link
And as you can see it is not showing here: hidden link
Also the counter said "8" entries, but it shows only 7.

#1128191

Hi Dietrich,

Thanks for writing back and I apologize for missing out this detail earlier.

In your view "Jobs mit Filter", the content template's output is wrapped inside two conditions:
( screenshot: hidden link )

1. [wpv-conditional if="( $(wpcf-jobpriority) eq '0' )"]...[/wpv-conditional]

2. [wpv-conditional if="( $(wpcf-jobpriority) eq '1' )"]...[/wpv-conditional]

Now, this arrangement will work for posts added through the edit screen, as you've set the "Priorität" custom field to store "0" in the unchecked state.

But since this custom field is not included in the form ( Stellenmarkt Anzeige ) that adds the jobs from the front-end, the value for this custom field remains empty for job posts added through it. This makes both conditions false and nothing is shown for such a job post in the view.

To fix this, you can update the first condition from:

[wpv-conditional if="( $(wpcf-jobpriority) eq '0' )"]...[/wpv-conditional]

To:

[wpv-conditional if="( $(wpcf-jobpriority) ne '1' )"]...[/wpv-conditional]

Hope this clarifies and please let me know if you need any further assistance.

regards,
Waqar

#1128965

Thank you, that helped me.