EyeDentify Posted January 17, 2017 Share Posted January 17, 2017 (edited) Hello Forum members. I just wanted to confirm with you PW gurus on here that i got the thinking behind regions in the latest blog post right:https://processwire.com/blog/posts/processwire-3.0.49-introduces-a-new-template-file-strategy/ So my understanding from the quick glance of the article is that if i were to use the new regions functionality it would in simple terms work like this: The referenced HTML in any of my other page template files would be inserted at the designated place in the home.php template file instead of replace it with all HTML in that page template file that was requested ? And the home.php template file would become sort of a View, that used HTML from the other templates files to change acording to the needs? So that i would only need to put the HTML that changed in my other page template files and have the "full" HTML markup in the home.php ? I just wanted to see if i got it right. Thx in advance. ProcessWire Official Markup Regions Documentation (New 2022-09-08)https://processwire.com/docs/front-end/output/markup-regions/ Edited September 8, 2022 by EyeDentify Added a link to the offical doc on Markup Regions 1 Link to comment Share on other sites More sharing options...
szabesz Posted January 17, 2017 Share Posted January 17, 2017 (edited) Hi @EyeDentify I think you got it totally right, at least this is also my understanding of it. EDIT: I missed this one: "...full" HTML markup in the home.php" This "full" markup is supposed to be in "_main.php", but I suppose it was just a mistake that you referred to "home.php". Edited January 17, 2017 by szabesz 1 Link to comment Share on other sites More sharing options...
EyeDentify Posted January 17, 2017 Author Share Posted January 17, 2017 51 minutes ago, szabesz said: Hi @EyeDentify I think you got it totally right, at least this is also my understanding of it. EDIT: I missed this one: "...full" HTML markup in the home.php" This "full" markup is supposed to be in "_main.php", but I suppose it was just a mistake that you referred to "home.php". I thought that the home.php was the central one in this. But maybe i missunderstood the article. What was the purpose of the _main.php file ? Link to comment Share on other sites More sharing options...
szabesz Posted January 17, 2017 Share Posted January 17, 2017 (edited) Quote: "Let's say that I'm using a _main.php file that serves as my primary document markup, like used in our current default site profile. It contains the main document markup, like this:" Ryan normally calls it _main.php (see: $config->appendTemplateFile = '_main.php') and this is where the skeleton of the HTML goes. This skeleton is extended and changed by writing code in the template files assigned to public pages, such as home.php. Otherwise you got it right I think. Edited January 17, 2017 by szabesz typo 3 Link to comment Share on other sites More sharing options...
EyeDentify Posted January 17, 2017 Author Share Posted January 17, 2017 11 minutes ago, szabesz said: Quote: "Let's say that I'm using a _main.php file that serves as my primary document markup, like used in our current default site profile. It contains the main document markup, like this:" Ryan normally calls it _main.php (see: $config->appendTemplateFile = '_main.php') and this is where the skeleton of the HTML goes. This skeleton is extended and changed by writing code in the template files assigned to public pages, such as home.php. Otherwise you got it right I think. Ok i think i got it now. So Ryan just includes the HTML in the included _main.php file instead of putting it directly in home.php ? Other then that i got it right ? Link to comment Share on other sites More sharing options...
szabesz Posted January 17, 2017 Share Posted January 17, 2017 Well, I'm not sure what you are referring to by "main.php", but Ryan's blog post can be understood by looking at the "site-default" profile. You might want take a close look at it. There is a _main.php file used by this profile, the whole article should be viewed in this context. Link to comment Share on other sites More sharing options...
EyeDentify Posted January 17, 2017 Author Share Posted January 17, 2017 Just now, szabesz said: Well, I'm not sure what you are referring to by "main.php", but Ryan's blog post can be understood by looking at the "site-default" profile. You might want take a close look at it. There is a _main.php file used by this profile, the whole article should be viewed in this context. I wrote wrong, i mean home.php not main.php for the "/" home path. 1 Link to comment Share on other sites More sharing options...
szabesz Posted January 17, 2017 Share Posted January 17, 2017 I see. Then the answer is yes. The "skeleton" of the markup is in _main.php, just like in the case of "site-default" profile. 2 Link to comment Share on other sites More sharing options...
EyeDentify Posted January 17, 2017 Author Share Posted January 17, 2017 34 minutes ago, szabesz said: I see. Then the answer is yes. The "skeleton" of the markup is in _main.php, just like in the case of "site-default" profile. Thank you for the help getting my head around this Now that i grasp it, i can see how usefull this could be in the future 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now