Ask the Bartender: Is There Still a Space for Building With HTML, CSS, and Template Tags?

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:

<?php wp_get_archives() ?>

And its block equivalent:

<!-- wp:archives /-->

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.

2

2 responses to “Ask the Bartender: Is There Still a Space for Building With HTML, CSS, and Template Tags?”

  1. “Whatever your new project is, approach it based on what the project itself needs.”

    That right there says it all.

    I’m working on multiple projects right now. In one I’m building some Elementor Widgets and another is a tool for building template parts in plain old HTML, CSS & Vanilla JS. It’s a tool for people who need to fine tune outputs for specific elements on a page. Well, actually you can use PHP and SCSS in it, but the point is the audience for what you’re building.

    In the first case it’s part of a PlugIn used by an Agency’s staff. These are extremely smart, intelligent and capable people – but with a very limited understanding of HTML and CSS. They don’t have time for it and honestly Elementor is a fantastic tool for them.

    The second is a PlugIn for developers that need to customize output from another PlugIn of ours. These are people who need to get their hands into the code and is a totally different set of people than the first.

    If it’s a tool for the general public, then embrace the change. But if it’s a niche tool and there’s a really good reason, then get yours hands dirty and get into the nitty gritty.

    Here’s my take on the current scene. Everything gets Elementor. Gutenberg is… a noble pursuit, but not something any of our customers are remotely interested in. It’s a good thing we use Genesis (Nope, Not Hello!) because the whole new block based sidebar widget screen is (trying to say this politely) something our customers would revolt on and Genesis already has the code snippet to restore sanity and put the widgets page back to normal.

    So it depends, but unless you’re building a site or a tool for the geeks of the world I’d just punt and put Elementor on there (no offense to Divi, it’s a close second and poor old Gutenburg… I’m sorry, but it’s not a tool that we would use).

    Report

  2. Ricardo says:

    Great post.
    I think I needed this answer to start running again.
    Thank you.

    Report

Leave a Reply to James C. Mailen Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: