Skip Navigation

[Resolved] Cannot add the Edit link to Views

This support ticket is created 5 years, 5 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 7 replies, has 2 voices.

Last updated by Minesh 5 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#1280953
Screenshot 2019-07-01 at 8.10.30 PM.png

Dear Sir/Madam,

I am going to prepare a dashboard to list out all the posts and some action button like Edit or Delete.

I follow the steps from https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/ but I don't see it is necessary to make a layout before doing this.

I make the Content Template and insert the Edit Form inside without associate the posts, I installed the Layouts plugins but I don't plan to use it for the post edit form because I don't know how I can embed the header and footer from the GeneratedPress theme.

When I add the edit link in Views, I get a message and not allow me to insert the shortcode into Views (see screenshot). I can add the delete link. Is it must have the layouts?

#1280963

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please try to follow the following Doc and try to resolve your issue:
=> https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/building-forms-for-editing-when-using-layouts/

#1280967
Screenshot 2019-07-01 at 9.09.03 PM.png

Dear Minesh,

I follow the steps and add the layout, it solved but I don't understand why it works. To my understanding, Layouts is used to format the whole page design including the menu, header and footer while Content Template is used to format a part of the content. In the steps, I didn't insert the menu element, why the form edit page still keep all the default page elements like menu, logo, header and footer?

What is the difference between layouts and content template, it makes me confused.

When I edit the post using the form, the previous and next Post navigation link show at the bottom of the post like the reading mode. How can I remove it only from edit form?

Best regards,

Kelvin.

#1280997

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

As you already read with the following step:

Give a name to your layout and do not assign it to any content.

As you stated - you should not assign this layout to any content and add the edit form to it, so basically here we are using the layout as an edit form container.

Layouts is used to format the whole page design including the menu, header and footer while Content Template is used to format a part of the content.
=> Generally, if you're using the Layouts plugin you should use a Template Layout to define a design for the main content area of your custom post type. If you're not using the Layouts plugin, you should use a Content Template.

Again, Layout is only affected on your the_content() (body part), Layouts do not control the header, footer etc..etc.. until the theme is integrated with Layouts.

If you are using one of our recommended themes you will see such theme options using which you can control such options. For example - if you are using generatepress theme:
=> https://toolset.com/documentation/recommended-themes/using-toolset-with-generatepress-theme/#controlling-generatepress-theme-options-for-templates-and-archives

Regarding the navigation links - is those links coming from your theme?

#1281007
Screenshot 2019-07-01 at 9.13.47 PM.png

Dear Minesh,

Yes, the navigation links are coming from GeneratePress, as the layout now is embedded into the theme as an edit form container, there is no page id when the form is in edit mode, GeneratePress needs to know how to differentiate the current post is under view mode or edit mode and then define the condition to show or hide the navigation links. GeneratePress suggests me to ask from Toolset.

I tried to deactivate the Layouts and I can select the content template when adding edit link from Views. After I activate the Layouts, I can only select the Layout template, I find both shortcode works

[toolset-edit-post-link layout_slug='post-editing-layout' target='self']Edit[/toolset-edit-post-link]
[toolset-edit-post-link content_template_slug='content-template-for-post-edit' target='self']Edit[/toolset-edit-post-link]

I would recommend Toolset to allow the user to select both from the content template and layout template if both are activated.

Best regards,

Kelvin.

#1281039

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

As per the structure only one method you should follow, if you don't want to use Layouts, just deactivate it otherwise content template will be overridden by Layouts. That is why we have two method, either use content template or Layout.

Here is the Doc how you can use the generate press theme with Layouts:
=> https://toolset.com/documentation/recommended-themes/using-toolset-with-generatepress-theme/

If you do not see the option to hide the navigation, you need to add custom CSS to hide it.

#1281085

Dear Minesh,

I know how to hide the element using CSS but how can I know whether the page is showing the edit form?

Best regards,

Kelvin

#1281469

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

When you click on edit link - do you see any URL param in the address bar - if yes, you need to target that URL param that if that URL param is that then add that custom css to hide the navigation links on that page.