Skip Navigation

[Resolved] How to display a CRED form in a layout

This thread is resolved. Here is a description of the problem and solution.

Problem:
How can I display a CRED form in a Layout?

Solution:
We suggest to use the CRED cells for this.

If you want to display a Link to a form, you should use the Visual Editor Cell to insert the Link.

If you display the link in a content template cell, you need to also call a Post Body to let CRED replace that post body.

Relevant Documentation:
https://toolset.com/documentation/user-guides/cred-form-cell/
https://toolset.com/documentation/user-guides/creating-cred-forms/

This support ticket is created 7 years, 10 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.

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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 10 replies, has 2 voices.

Last updated by Tristian 7 years, 8 months ago.

Assisted by: Beda.

Author
Posts
#412559

I have a Post Form to create content - this is working:

hidden link

I have another Post Form to edit this content once it has been created using this shortcode within the loop:

[cred_link_form form='60' form_name='Update Company' text='Edit %TITLE%' target='_self']

You can see this link generated below the title of this page:

hidden link

I click the link to bring up the edit form and the link disappears and nothing happens apart from URL has ?cred-edit-form=60 appended to it:

hidden link

and nothing happens.

I have also noticed I cannot preview any CRED forms in the back-end, I just get a blank white page.

I only have the Toolset Plugins installed - no others. I have tried disabling Access plugin and same thing happened after looking through support forum.

I have deleted the CRED form (was previously ID 59) and recreated it (now ID 60) and the same thing happens.

Site access is available if required.

Thanks

#412729

I am pretty sure you do call the CRED Edit Link in a Layout.
Because there the issue is confirmed.

If you call the CrED Edit Link in any Post or content Template (but not in a Layout) it will work fine.
This is the CRED Edit Code syntax for reference:

[cred_link_form form='31' form_name='Test' text='Edit %TITLE%' target='_self']

Can you please confirm you see the issue only when you use the CRED Edit Link in a Layout?

For your reference:
https://toolset.com/forums/topic/cred-form-edit-does-not-work-it-dont-show-edit-form/

#412788

So I cannot place any view or content template that has a CRED edit form in a layout - this is going to affect almost everything I am doing!?

I am using Layouts for the whole site - I have Archive Pages, Views and Layouts all using edit forms but all of them are used in Layouts and none of them work?

#412791

Also, why does my preview form not work, how can I work around this issue and is there likely to be a solution anytime soon from the developers?

Thanks

#412793

So a Content Template\Archive placed in a layout are fine. I was also missing the [wpv-post-body] which meant the form wasn't being rendered:

https://toolset.com/forums/topic/cred-edit-form-not-working-in-a-layout/

It would be good to know when this is scheduled to be fixed though and why my forms 'Preview' is not working?

#412919

I apologize the delay here.

The issue with the CRED Edit link not working seems to happen only if the CRED Edit Link is present only in a Content Template.

If you insert it to a Visual Editor it works in my tests.

It does also not work in a View, as far I tested.

I can also see the issue with the CRED form loading an empty screen when preview the CRED Forms.

This happens only when you have Layouts (and a theme like Toolset Starter Theme) active and it is because the CRED Preview is loading the preview in the Main Home Page (index.php)
As long there is no Layout assigned there, it will not work.

Only after you create a Layout and insert a empty Content Template to the layout, it will work.
I reported this as a usability issue.

#416179

There is work in progress here, we re analizing and reviewing where possible.

For now please use the Visual Editor, there is no other workaround I can present.

I know this is not a valuable solution, but I can not provide any fixt to this delicate matter.

I will update you here once this is either pathced or fixed in a future release.

#416181

I just saw, that the issue with the CRED Edit link is planned to be fixed with layouts 1.8 (next release)

The preview issue is not yet scheduled.

Therefore I put this Ticket now into "Fixed in next release" status, and will update here once it is solved.

#416192

Thanks Beda. I could never get the 'Preview' CRED form to work even though I added [wpv-post-body] to default page\post layout through a content template. Not to worry though as can easily work around this.

#422031

Please find below the process to follow and how it will (and already does) work.

1. CRED Form LINK as a ShortCode is not working in a Content Template if we do NOT call a post body ([wpv-post-body view_template='None']) as well in that same Content Template.

2. The CRED Form Link as a ShortCode in a Visual Editor works perfectly fine, without any call to Post Body, and it is suggested to use the Visual Editor to do this.

3. A view Cell, which queries those posts, and holds the CRED Link as a ShortCode, works as long you do not edit the post to which the layout is assigned (as current viewed post), in other words, the current post.

This means when you uncheck "Don't include current page in query result" in the View, and then visit the current Post styled with Layout, which holds the View Cell, editing the very same post will not work.

This is solved by calling the Post Body in a Content Template Cell in your Layout.

If you do check the option "Don't include current page in query result" in your view, the Current Post will not be available anyway and every other post will be editable through those links.

No post body needs to be called in this case at any place.

4. A View Shortcode (same view as above), Works the same way as described above.

So to conclude, you need either to call the Post Body as well, so CRED can replace it, or, you use the Visual Editor Cell.

Regarding the other issue, please await the next release.

#425798

Thanks Beda - adding the Post Body resolved the issue.

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