I’m still wondering about the best method to approach a new project.
As a background, besides the traditional way, I’ve worked with Divi, love Bricks, and am loving Blocks. But I still feel that there is nothing like building a website from the root, with raw material: HTML, dynamic PHP, and CSS — even more now with the importance of performance and the new server-side of things.
Plus, the ability to play with dynamic data (and the database) with template tags is so smooth and efficient that it really feels like superpowers.
So, it feels a bit strange, but I’m wondering if template tags are going to end too?
Ricardo
You are asking a guy who was so nostalgic for the “simpler” days that he built his own custom blogging system over a weekend. And, I actually still use that same code, albeit updated and refined, for my personal blog today. When I began that project, I laid the foundation with modern PHP and build tools. However, at the heart of it, I just wanted to get back to those foundational elements of the web: HTML and CSS. I feel where you are coming from.
That project was fun to build for my own edification and enjoyment, but it essentially has a user base of one. Designing the front end for it feels very much like WordPress of 10 – 15 years ago.
When you said using template tags was like accessing “superpowers,” it brought on a wave of nostalgia of those days and weeks when I first started using them. It was such an elegant system. Anyone could grab some dynamic data by copying a code snippet and pasting it between some HTML elements.
For those with the skills or enough DIY grit, they can do anything with a little bit of code, trial-and-error, and time. However, if we are going to empower more people, developers need newer and more powerful technologies to make that possible. For WordPress development, that means embracing the block system, which seems like something you are doing.
Template tags are not going away. They are just PHP functions for getting some type of data. They will be around for a long time, likely as long as WordPress itself is still kicking.
Many blocks actually rely on these template tags for outputting dynamic data on the front end. For example, the Archives block is literally a wrapper around wp_get_archives().
If you prefer working from a code editor, you could look at blocks as modern-day template tags for WordPress. They are merely snippets of HTML code with a bit of JSON mixed in as an HTML comment. Many also display dynamic data.
There is really no difference between the following template tag:
And its block equivalent:
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- June 2021
- May 2021
- April 2021
- March 2021
- February 2021
- January 2021
- December 2020
- November 2020
- October 2020
- September 2020
- August 2020
- July 2020
- June 2020
- May 2020
- April 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- September 2019
- August 2019
- July 2019
- June 2019
- May 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- November 2018
- October 2018
- September 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- February 2017
- November 2015
- March 2015
- January 2015
- August 2014
- February 2014
- January 2014
- December 2013
- October 2013
- September 2013
- May 2013
Both spit out dynamic data. The difference is the syntax.
Granted, that is one of the simplest examples. Sometimes the block code is more complex. Other times, not so much.
What makes blocks more flexible is that they are built on a standardized system that empowers users to interact with them on the admin side.
Web development is an industry where you must continually adapt, learning new syntaxes, programming languages, libraries, technologies, and more. Just when you think you have mastered one thing, something else comes along to toss your world upside down. It can be both frustrating and fun. Over time, you just learn to roll with it.
While template tags are not going away, how front-end developers build will change in the coming years. For most projects, they will work with blocks. However, block theming is in its infancy, so it is not something anyone must rush into.
With that said, the beauty of WordPress is that there is no one way of using it. If you want to build with just the raw materials, you can always do that. It may even make some projects easier, particularly if you have a simplified scope.
As far as performance goes, WordPress is pretty fast out of the box. Plugins and the active theme can improve its speed or make it a lot worse. Thanks to some improvements in 5.8, block styles are far more efficient.
It sounds to me that we are kindred spirits. We appreciate the simplicity — at least what we personally view as simple — of just diving into the building blocks of the web. And, there is nothing wrong with that.
However, as a professional, you are building themes for customers or performing a service for a client. The technology or the tools you use do not really matter as long as they allow you to cater to your users.
Maybe that tool is a third-party page builder on a client site. Perhaps you are building a block theme for public release on top of WordPress. Or, it could be a personal project, an itch you have been wanting to scratch. You load your code editor and begin tapping the keys. After a weekend of caffeine and junk food, you realize you have built something new and exciting from the ground up.
Whatever your new project is, approach it based on what the project itself needs.
Like this:
Like Loading…
Source