Skip Navigation

[Resolved] Stop using Layouts, and keep all content template formats

This support ticket is created 5 years, 6 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
- 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+00:00)

This topic contains 9 replies, has 2 voices.

Last updated by davidm-13 5 years, 6 months ago.

Assisted by: Nigel.

Author
Posts
#1275093
stop-using-layout-template.JPG

Tell us what you are trying to do?
I want to "stop using this template layout" but keep all the content template formats that make up the page. The page is composed of 3 Views when I stop using Layouts I see only 1 unformatted View.
I do not want to use the Layouts plugin, for me it only adds another level of complexity, but I have no idea how to disentangle myself from it and keep all my page intact.
I think it's also creating a conflict with GeneratePress sticky navigation setting.
Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?
hidden link

#1275499

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

Hi David

Toolset offers two kinds of templates for displaying single posts, namely Content Templates and Template Layouts.

Content Templates are the simplest: they are just containers for HTML (where dynamic content is inserted through shortcodes).

Template Layouts are more complex: using Bootstrap they provide a way to structure different pieces of content within a grid structure. Different cell types are a step-up from shortcodes but serve a similar purpose, namely to output text and HTML.

If you drop Layouts then the key thing you lose is the grid. It is still available to you in Content Templates, but no longer with a drag and drop interface, you must set up the HTML markup manually.

If you had 3 Views in a Layout and you disable Layouts, you could assign a Content Template to the same content type and insert the same 3 Views.

But they would appear one after the other, and design splitting the Views across columns—for example—would be lost.

Also, if you had added any custom formatting to your Layouts, custom CSS classes etc., then you would naturally lose these too, but you should be able to reproduce them when using Content Templates.

Because WordPress is moving in the direction of including a page-builder-of-sorts into core, namely the Gutenberg block editor, we are supporting that shift by making it possible to design Content Templates using Gutenberg blocks, which might be a good substitute for Layouts.

See the original blog announcement here: https://toolset.com/2019/04/toolset-blocks-visual-design-dynamic-content/

We should be moving to a production release in a matter of weeks.

#1275967

Hi Nigel, Thanks for the explanation.
It's still not clear to me how I can receive

hidden link

without using Layouts. If I stop using Layouts then I receive the above screenshot
stop-using-layout-template.jpg.

My page is composed of 3 Views each with their content template "loop item in view".
The Edit page using Layouts contains 1 line:
[CODE]
<p>[wpv-view name="plant-common-names" ids="[wpv-post-id id='$current-page']"]</p>
[/CODE]

within the View plant-common-names I have:
Loop item in plant common names
which contains the html at the top of the page followed by
[CODE]
[wpv-view name="complaints-list-new-table"]
[wpv-view name="other-uses-list"]
[/CODE]

How can I receive the full page without using Layouts?

Thanks for your help
David

#1276331

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

You have inserted the plant-common-names View into the page that you are no longer using Layouts for?

It would help if I could see how you have this set up for myself in the back-end.

I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site.

#1276349

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

Hi David

There was something odd about your set-up. I'm not sure how you arrived at the situation, but when you create a template (whether a Views Content Template or a Template Layout) you normally assign it to a post type, and then all single posts of that type are displayed using the template.

But on your site you had a Template Layout which you had individually assigned, plant by plant, for over 200 plants, to each post, rather than just to the post type.

I'm not sure that's what you had intended.

In any case, the template included nothing more than a call to the View.

So, I de-activated Layouts so that its templates are no longer being used, and made a Content Template "Template for single plants" which simply outputs the same parent View, and assigned this to the plants post type so that all plants will use it.

Visiting some plant posts on the front end they appear the same as before as far as I can tell.

Is there anywhere else that you have used Layouts that you need to check for changes?

#1276403
Single-plant-page-top.JPG

Hi Nigel,
It's odd 'cause I was just fumbling around without knowing what I was doing, not knowing where to use what.
I prefer to do things manually without Layout black boxes, so I can see the html and css and fine tune.
Anyway instead of "Template for single plant" I need to see "Loop item in plant common name" content template - see screenshot of how the page should look

#1276431

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

Because that template is already part of a View there is not the option to assign it to a post type.

What you can do, though, is simply copy and paste the markup from that template into the Template for single plant template I made which is currently assigned to plant posts.

#1276677

Hi Nigel,
Got it.
After copying as you suggested still didn't work until I went to Edit Plant and changed the Content Template to "Template for single plants" - these senior developers are a bit slow!
Now I've been struggling with another problem -the sticky nav menu that I'm using (from GeneratePress) disappears half way down the page.
I've been in touch with GeneratePress and after some checking they say that the problem may be with Toolset. Do you think you could take a look and let me know if you have a solution.

Thanks for your help
David

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

https://toolset.com/forums/topic/problem-with-generatepress-sticky-menu/

#1277161

Nigel
Supporter

Languages: English (English ) Spanish (Español )

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

Let's move that to another thread, I'll take a look at the issue there.

Note that if you edit a Content Template you can assign it to a post type and it will be used by all posts of that type (you may need to confirm that you wish to "bind" the template to the posts), you don't need to edit each post individually and set the template (although you can do that with individual posts which you want to use a different template, or no template).

I think we can close here?

#1277657

Thanks Nigel, Very helpfull as always. Learnt alot, hopefully that means I'll bother you less.