Skip Navigation

[Resolved] Content Template or Layout?

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

Problem:
I'm struggling to decide wether to use Layouts or only Content Templates created with Views.

Solution:
1. It's generally better to either use Toolset Layouts or Content Templates - not both applied to single content. You would use Content Templates in loops if you use Layouts generally for posts and pages. If not using Layouts you'd use Content Templates everywhere possible.

2. Toolset Layouts doesn't allow you to create Content Templates if you don't use Views. If you do, you can display Content Templates and even create them thru the Layout GUI. But in fact, Content Templates rely on Views. Content Templates can apply to single posts or entire post types or just on those posts on the archive of that type.

3. Toolset Layouts adds 2 Drag and Drop builders to WordPress, one for general (Template) Layouts that can be applied to single posts, or a post type, or an archive and more, and the (Content) Layouts that are applied and generated for every single post when editing the post.
Content Templates do the same but there you don't have a Drag and Drop Builder. Also, you cannot simply call related (parent) Layouts.

4. All 3 (Content Templates, Template Layouts and Content Layouts) will apply only to the_content() part of your posts (the post body). They will not allow you to design anything around that post body.

5. Toolset Layouts can, with the correct programmatic integration, be used to design the templates including sidebars and other elements, but other PageBuilders are very advanced on this meanwhile and we rarely recommend this approach anymore, unless needed or requested.

6. The main advantage of Layouts is it has an automated Bootstrap Builder, you drag around elements and it generates the HTML and outputs it - while in Content Templates you need to write the most HTML on your own.

7. For an existing site built with Content Templates, I wouldn't recommend starting using Toolset Layouts. Better would be editing the Content Templates with the new Gutenberg Builder of WordPress, also using Toolset Blocks.

This support ticket is created 4 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.

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)

Author
Posts
#1269665

Tell us what you are trying to do?
- I am trying to have two types of information to be displayed in the content template.
example: i have a student enrolled in a class. When the teacher click that student post tytle with a link, it brings to the content template. However there is some information that could be displayed for the teacher, but the school has more information for that student that is not allowed for the teacher to see. how I could create such a differentiation? is there possibility to create different views that would display some informaiton but not all? can I devide the content template to display certain information in relation to the role credentials for different users?
thanks

#1269757

The easiest probably would go either with Toolset Access Conditional ShortCodes or HTML Conditional:
https://toolset.com/documentation/user-guides/access-control-texts-inside-page-content/
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

Both methods can help you to check who's currently viewing content, and display only either or content depending on the user role or other details.

Hence I'd suggest using these 2 solutions in the Content Template applied to your posts to determine who can see what, and give the different users on your site different roles, so you can finetune the capabilities.

#1271177

Perfect, I think that will solve the problem.
I also have the plugin Layout which is deactivated at the moment. I already have about 15 post types with their assigned single page content template.

If I want to activate the Layout pluging, will it interfere with what I have already set up with views plugin?

Is it true that layout allows me to create several content template, or the content template can only be one per post type?

Does Layout help me better with the page out put or it really does not matter if I use views as long as I understand the basic of HTML and CSS

#1271617

1. It will not affect the settings for posts or pages already done, however, it's better to either use Toolset Layouts or Content Templates - not both applied to the content.
2. Toolset Layouts doesn't allow you to create Content Templates. Those can only be created by Views. Content Templates can apply to single posts or entire post types or just on those posts on the archive of that type.
3. Toolset Layouts adds 2 Drag and Drop builders to WordPress, one for general (Template) Layouts that can be applied to single posts, or a post type, or an archive and more, and the (Content) Layouts that are applied and generated for each single post when editing the post.
4. All 3 (Content Templates, Template Layouts and Content Layouts) will apply only to the_content() part of your posts (the post body). They will not allow you to design anything around that post body.
5. Toolset Layouts can, with the correct programmatic integration, be used to design the templates including sidebars and other elements, but other PageBuilders are very advanced on this meanwhile and we rarely recommend this approach anymore, unless needed or requested.
6. The main advantage of Layouts is it has an automated Bootstrap Builder, you drag around elements and it generates the HTML and outputs it - while in Content Templates you need to write the most HTML on your own.

I hope this helps to make a decision - at this stage, I probably would not recommend installing Layouts unless you plan to actively use it for some advantages.

#1273041

Beda, you helped me solving all my question on this issue. I appreciate the time to detail it well. now I have the whole picture. I will continue with views since I am more familiar with it.

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