ryan Posted Friday at 10:13 PM Posted Friday at 10:13 PM This week I've added support for File Regions, part of the Markup Regions output system in ProcessWire. File Regions enable you to populate CSS and JS files with Markup Regions. I'm short on time today, so rather than writing much about it here, I've put up a documentation page for it in the API reference, which I'll link below. I'm using File Regions on a project right now and am finding it to very useful. Especially on a project where there are multiple developers, it simplifies a lot to be able to build features as self contained components, while still using the traditional route for site-wide stuff. It's something different, and I'm curious to know what you think. Here's the new documentation page for File Regions below. The page was a bit rushed, so I'll likely be amending it, but hopefully it gets across the main ideas. Thanks for reading and have a great weekend! https://processwire.com/api/ref/wire-markup-file-regions/ 9
cb2004 Posted Friday at 10:47 PM Posted Friday at 10:47 PM @ryan looks amazing to me. I use region("gallery", true) or similar in repeater matrix files and then do some logic in _main.php currently. Guessing this could replace that, or do markup regions not look that deep within repeater matrix template files? 1
ryan Posted 14 hours ago Author Posted 14 hours ago @cb2004 Probably just regular markup regions would handle that just fine. Unless I misunderstand, I don't think you'd need file regions for that. Where file regions would be helpful is if you wanted to keep all that repeater matrix output code self contained, perhaps in your repeater matrix template file. Like if you had certain CSS and/or JS that was just for that repeater matrix stuff, you might find it easier to build and maintain longer term if the output code is all kept together, rather than spread across different files. That's one thing I find file regions particularly helpful for so far.
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