Skip Navigation

[Resolved] Can I create my own page templates with code?

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.

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 5 replies, has 2 voices.

Last updated by mikes-23 7 years, 10 months ago.

Assisted by: Beda.

Author
Posts
#425654

Hi,

I am sitting here in Limbo unable to work on my project due to my other topic:

https://toolset.com/forums/topic/how-do-i-add-responsive-bootstrap-values/

If Layouts are not responsive then I cannot use them. Is it possible for me to write the layouts like a normal theme (i.e. page-type.php) then call the views I created in the template code?

As far as I can see, when the toolset views plugin is active it overrides the templates hard coded page templates.

Can you give me some advice here as I have already lost a day because I am not proceeding until I know I can offer a properly responsive front end.

Thank you.

#425734

Layouts is responsive, I am not sure why you mean it is not.
It uses Bootstrap and whenever you add a layout to be the template for a Type (Post, page, etc), the content will be resizing (responsive) on screen resize.

Given that the "sm" class is always added, and you want to use different ones depending on screensize, yes you can of course code your templates manually, just as you do in "normal" WordPress Themes.

Views will do what follows:

1. If you use a Content Template, it will replace the_content() function of the WordPress Loop

That means, all HTML around the_content() is still used.

2. If you insert a View (A list of Posts as example), this will just appear where ever you insert it.
So as example if you insert it in the Post/Page Body, and add some Text above or below, the View will appear exactly where you planned it to be.
Again, all Template HTML will not be overwritten.

3. You can also use the Views API, that allows you to call a View with a PHP Snippet.
This will then act similarly to the above #2, just that you will code it into your WordPress templates.
https://toolset.com/documentation/user-guides/views-api/

As in the other post elaborated, you can also use the Layouts API to customize your "framework", means to change the prefixes or filter them, as per your needs.

#425905

Hi Beda,

As far as I can see It's only responsive if you want less columns on larger devices than you want on smaller devices. I am struggling to see how that is useful.

For instance, most websites have several columns on large screen that go down to a single column on a mobile. This is impossible as far as I can see in layouts.

I tried adding sm-col-12 rows and then adding the smaller columns for larger devices but layouts will add each row inside a seperate row tag so this is impossible.

Maybe I have missed something. Can you give me an example where layouts adapts responsively for a mobile device as maybe I am just completely misunderstanding something?

#425907

For instance. Lets say I want a footer with 3 widget areas. On large devices the 3 columns would all be on the same row. On a mobile device then would all be full width ontop of each other horizontally.

How would I achieve this?

#425910

I meant vertically.

So large deviced:

[column 1] [column 2] [column 3]

Mobile:

[column 1]
[column 2]
[column 3]

This is my concept of responsive design. How do I do it in layouts?

#426320

Using the global filter replace is workable if all smaller columns are then added manually. I can either do that or make my own templates so ill mark this as resolved as I see you guys are busy.

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