Skip Navigation

[Resolved] How to hide post when "post content" element is populated with Edit post form

This support ticket is created 3 years, 4 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 9 replies, has 2 voices.

Last updated by himanshuS 3 years, 4 months ago.

Assisted by: Christian Cox.

Author
Posts
#1875919

Tell us what you are trying to do?
I want to edit a post and have created a content template and have added an post content element to the page. The edit post link works beautifully and the edit form shows up. But, as I am using elementor, both the current post and edit form are visible on the same page. How do I hide the post content from the page when the "post content" element is populated. I looked for a shortcode for post content but could not find one. I used the wpv-post-field shortcode but that did not work.

Can you please help?

#1875989

Hi, the wpv-post-body shortcode is usually used to display post contents:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body

[wpv-post-body view_template="None"]

However, I'm not sure I understand how this shortcode will help you hide the content of the post. Can you explain a bit more how you want to use this shortcode to hide or display the post contents?

#1876087

I was hoping to use the output of [wpv-post-body view_template="None"] in a dynamic condition widget on Elementor to hide the post content and only display the edit form. It seems like the edit form is only populated in the post content module but not in the shortcode ([wpv-post-body view_template="None"]). Now I am stumped and not sure how to hide the post content from users and only display the edit post form.

Can you please help?

#1876141
Screen Shot 2020-12-14 at 1.34.12 PM.png
Screen Shot 2020-12-14 at 1.34.02 PM.png
Screen Shot 2020-12-14 at 1.33.57 PM.png
Screen Shot 2020-12-14 at 1.33.49 PM.png

I may be misunderstanding how you have the templates and links setup, because normally the post content does not appear in the page when you have the Edit Post Form link displayed in the post and the Edit Post Form inserted in a separate Content Template.
- When you click the Edit Post Link, what is the resulting URL structure?
- Is a Toolset Content Template also assigned to this post?

You can see a similar setup on my test site. I have an Elementor Template assigned to all Single Posts. Inside that Elementor Template is a post content module. In the contents of the post, I have created an edit post link manually using HTML. When I click that link from the front-end post, I am redirected to a URL like this:
https://mysite.com/path/to/post/?content-template-id=1234
The number at the end of the URL is the same as the ID of the Content Template that includes my Edit Post Form shortcode. When the page loads, I see an edit post form, but the contents of the post are not displayed outside the form.

#1876213

It doesn't seem to work for me.

The url has the template: hidden link

You can view the flow in this GIF: hidden link

#1876217

Okay may I log in and take a closer look at how this is all set up? Private reply fields are active here so you can share login credentials.

#1876245

I need to take over editing some Elementor templates temporarily so I can see how they are set up. I'll give you another update shortly.

#1876331
Screen Shot 2020-12-14 at 3.31.07 PM.png

Okay I understand a bit more now. The issue is not that the post contents are being displayed - the post contents are empty as you can see in the screenshot here. The issue is that the Elementor template contents are being displayed as well as the Edit Post Form. So you would need some type of dynamic condition in the Elementor template that would hide the other Elementor template contents when the ?content-template-id URL parameter is included in the URL. I'm not really sure about how Elementor conditions work, so I'm not the best source of information about that. The Elementor plugin's support team may be able to tell you more about whether or not testing a URL parameter is possible in their dynamic conditions system.

Normally the suggested workflow is to insert a post content module in the Elementor template. That post content module will be replaced with the Content Template that includes the Edit Post Form when you click the Edit Post Link to redirect to the ?content-template-id URL. However, in your case, the Elementor template includes other elements besides the post content module. Toolset's Post Content module integration does not impact the display of those other template elements, only the contents of the Post Content module inserted in that template.

This usually works when the post content is designed with Elementor, but in your case, the post contents are not designed in Elementor. Most of the design is in an Elementor template applied to the post, so the Post Content Module replacement solution isn't very practical unless there is some way to hide the other Elementor template elements conditionally, based on that URL parameter.

#1876345

Thank you. That makes sense.

#1876347

My issue is resolved now. Thank you!

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