Skip Navigation

[Gelöst] CRED form is showing in wrong place on page layout

This support ticket is created vor 7 Jahre, 5 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 2 Antworten, has 2 Stimmen.

Last updated by ashleighP vor 7 Jahre, 5 Monate.

Assisted by: Nigel.

Author
Artikel
#450333
messed up with cred form.png
without cred form works fine.png

I am trying to: Create a page that shows the post content and the edit form for that post in the same page. (The CPT is for a proof and the form is for approving the proof.)

I visited this URL: (private)

I expected to see: A page with a description, PDF file, and the edit form below that.

Instead, I got: For some reason, the form is replacing the description, even though the description is NOT the post_body but a custom WYSIWYG field. It's also causing the Adobe Reader plugin to fail (it works just fine when the URL doesn't have the ?cred-edit-form variable).

Here's the code for the content template

<!--Show only if user is logged in; or if user is admin-->
[wpv-conditional if="( '[wpv-current-user]' eq '[wpv-post-author id='$event']' ) OR ( '[wpv-current-user info="role"]' eq 'administrator' )"]

<a href="[wpv-post-url id='$event']">Return to [wpv-post-title id="$event"]</a>
<h1>[wpv-post-title]</h1>
[wpv-conditional if="( '[wpv-current-user info="role"]' eq 'administrator' )"]<p>You're seeing this as an admin.</p>[/wpv-conditional]

<h3>Notes from the Designer</h3>
[wpv-autop][types field='proof-notes'][/types][/wpv-autop]

<object data="[types field='proof' link='true' output='raw'][/types]" type="application/pdf" width="100%" id="proof_embed" class="hidden-xs" style="min-height:600px;">
  <p>It appears you don't have a PDF plugin for this browser.
  No biggie... try out <a href="<em><u>hidden link</u></em>">Adobe Reader</a>.</p>
</object>

<p class="visible-xs-inline">You'll need a desktop computer to view your proof.</p>

<h2>Proof Details</h2>
<p>This proof was uploaded on: [wpv-post-date format="F j, Y g:i a"]</p>

<a href="[types field='proof' link='true' output='raw'][/types]">Download this proof.</a>

<h2>Your response:</h2>
[wpv-conditional if="( $(wpcf-proof-approval) eq '0' )"]
[wpv-post-body view_template='None'] <!--where cred form should show up-->
[cred_link_form form='5325' form_name='Event — Proof Response' text='Respond to this proof' target='_self']
[/wpv-conditional]

[wpv-conditional if="( $(wpcf-proof-approval) eq '1' )"]<p>This proof has been approved. Yay!</p>[/wpv-conditional]

[wpv-conditional if="( $(wpcf-proof-approval) eq '2' )"]
<p>You requested some changes to this proof. Here's what you said...</p>
<div class="callout">[wpv-autop][types field="proof-changes"][/types][/wpv-autop]</div>
[/wpv-conditional]


[/wpv-conditional]

#450462

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+01:00)

Screen Shot 2016-10-26 at 07.58.09.png

Hi Ashleigh

There is no reason in principle why you can't display a post and a form to edit that post on the same page.

In the screenshot you will see that I made a Content Template for standard posts and inserted a post edit form for that post below the post content.

You say that you want to include the form below the post content, but the CRED shortcode you include is to link to a CRED form, not show it on the same page.

When you insert a CRED shortcode for an edit form using the CRED button on a post edit page, the advanced options at the bottom allow you to specify whether you want to insert the form on the same page or a link to the form.

Inserting it on the same page will add a [cred_form] shortcode rather than the [cred_link_form] shortcode you have.

If that doesn't display the form correctly in place, for testing I would make a new Content Template for your CPT which simply outputs the post body and below that the [cred_form] shortcode for your post edit form and nothing else.

Once you are satisfied that works as expected you can start adding back your conditional content and custom fields as required.

#450678

Okay, I changed the edit form link to the actual edit form, and it does show up right without the url parameter.

I will just remove any links to the edit form since the page still doesn't display properly with the url parameter.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.