Jump to content

Confused about Markup Regions in PW? Read this!


EyeDentify
 Share

Recommended Posts

I as have been a bit confused for some time about how the "Markup Regions" functionality in Processwire worked.
But i have know read a bit more and think that i am getting to grips with it. And Markup Regions is going to be huge.

To aid me in understanding Markup Regions better i started to read the Source code for the new "Regular" theme in conjunction with the Blog about the markup regions.
It helped me a great deal to understand the basics and more fine details of it.

A tip is to open both links and use the Source code of the "Regular" theme while reading the blog post.
 

The Source code:

https://github.com/processwire/processwire/blob/dev/site-regular/templates/_main.php

The Blog post:
https://processwire.com/blog/posts/processwire-3.0.62-and-more-on-markup-regions/

Markup Regions in ProcessWire (New - 2022-09-08)

https://processwire.com/docs/front-end/output/markup-regions/

I hope this could help others starting out with markup regions.
Just take it slow and read it a couple a times and soon you will see the greatness of markup regions.

/EyeDentify 

Edited by EyeDentify
Added a link to the offical doc on Markup Regions
  • Like 2
Link to comment
Share on other sites

I'm actually more confused about an apparently new (to me) way to use the API... I've never seen code writen like this before:

$home = pages()->get('/'); // instead of $home = $pages->get('/');

I see in the config file 

$config->useFunctionsAPI = true; 

Is that the reason? Do you happen to know when this was introduced or announced? Can it do certain stuff faster/better or different than the old-school PW API syntax?

Link to comment
Share on other sites

25 minutes ago, dragan said:

my bad, of course searching before posting would have been more clever - I found it:

https://processwire.com/blog/posts/processwire-3.0.39-core-updates/#new-functions-api

 

No Worries. Indeed its a fairly new API.

You can also check it out in the source code at:
https://github.com/processwire/processwire/blob/master/wire/core/FunctionsAPI.php

For more details. Hope you find it useful.

Cheers.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...