27 Oct 2021

feedWordPress Planet

HeroPress: Becoming a Global Citizen

Pull Quote: Exposure to the global community taught me a new meaning of citizenship.

I haven't accomplished some amazing achievement, or overcome some insurmountable obstacle. I haven't been through some extreme hardship, or dealt with a personal tragedy. In life, I have been significantly influenced by a negative voice inside me that tells me I'm an impostor and focuses on my past failures and things about myself I cannot change. In short, I don't see myself as a hero. However, being a part of the WordPress community has taught me to not be too hard on myself and appreciate things I take for granted. This essay is a summary of the personal struggles I have had, mostly alone, in my head.

My family teases me that I started learning to speak after I turned four. I think they exaggerate but it fits my personality. I am slow, it's not a big impediment, but people point it out sometimes (Like at 13:25 on this WordCamp video) . I am highly sensitive both emotionally and physically to things like bright lights, strong smells, heat and cold. I easily get overwhelmed under pressure or in emotionally or socially tasking activities. As a child, I was under a lot of pressure to be normal. To wake up! Speak up! Stop crying! I carried that pressure into adulthood and spent the first 30 years of my life trying to be 'normal'. As much as I pushed myself to be more outgoing, work harder, be stronger I only ended up an exhausted, frustrated multiple time college dropout.

Finding WordPress

In 2016 I started learning WordPress with the goal of becoming a web developer. In October of that year, I found out there was a new WordPress meetup in Harare and signed up to attend straight away. Before my first meetup I expected to meet a bunch of condescending tech bros who I hoped would at least tolerate me. What I found there was the total opposite, a diverse group of people who wanted to learn and share their knowledge. What topped it off was when Thabo Tswana, who founded the meetup, ended with the invitation to host meetups. His message was anyone was welcome to host or attend a meetup, whether you were a beginner, professional, blogger, business owner, or developer, everyone is welcome. I was hooked! I signed up to speak at the first WordCamp Harare, and went on to become a meetup organizer, and even lead organizer of WordCamp Harare 2019!

Exposure to the global community taught me a new meaning of citizenship.

Not the kind of citizenship with arbitrary borders and exclusive membership. The citizenship I learned from the WordPress community is one that accepts everyone as they come with one main condition, to genuinely want what's best for each member and the community as a whole without necessarily needing to agree on what that means. I also learned how to deal with the tension of trying to fit in when you have traits that force you to stand out.

Real Diversity

The WordPress community's acceptance of diversity doesn't just mean accepting people as they are, but pushing them to do their best for themselves and society. I have learned from the WP community to lean into my abilities, and also find the best ways to improve on my weaknesses. As an introvert I've learned to cultivate my personal interactions at meetups and WordCamps and it has created many opportunities. I've also learned from other introverts to pace myself when I attend social events. There's no need to shake everyone's hand (or fist bump since the pandemic). It's also good for me to plan ahead for a day away from the world to recharge after big social events.

One of my favorite hacks has come from conversations about accessibility. I discovered that using a screen reader increased my dismal reading speed from 150 words per minute to the average person's reading speed of 250!

Getting Practical

Finding myself is all well and good, but I still need to make a living. I have struggled in that regard. I tried being a freelancer, and working as a web designer/developer for companies, but never found the right fit. I've given myself excuses like slow internet or a crappy laptop. In 2019 we had daily 13-hour electricity blackouts that disrupted life for everyone who couldn't afford backup power during the day as electricity was only available at night. All very good excuses, but there'll always be excuses no matter what you are doing.

I've been asked where the money is from this "W" thing I do, and when I'll get a proper job, and I never had a definite answer.

I come from a utilitarian culture where direct input should always equal direct results. I initially tried applying the same thinking to my WP journey, but it's not as simple as planting a seed, giving it water and fertilizer and watching it grow. That is where personal growth becomes a practical tool. There is no absolute formula to success. I have been gradually making minor personal adjustments as I go and my income has gradually grown in amount and consistency.

As long as my 5-year WP journey has been, I'm still at the beginning of it. For anyone looking to make it in WordPress, I can't promise you success. But what I can promise you is that if you intentionally seek out solutions from the people who have come before you, you will gain the skills to be successful no matter where you go.

27 Oct 2021 6:00am GMT

26 Oct 2021

feedWordPress Planet

WPTavern: The ‘Pattern’ Block and How It Fixes a Longstanding Issue With Dynamic Data in HTML Templates

As I was perusing the latest block themes on WordPress.org, I came across a new favorite: Bai. The typography was on point for those who tend to write long-form content. Plus, it has a built-in dark mode design that did not make me want to rip my eyes from their sockets. I had planned to review it, but I did not have much to say. It is simply a solid design without much in the way of extras.

However, in the particular test environment I had set up, one piece of it was broken. I ran into a longstanding issue with the block system.

The default "intro" image used on the homepage will return a 404 if WordPress is not installed in the root directory or if the /wp-content folder has been moved. I switched it to another test site using the default configuration to make it appear.

Bai theme homepage.

This is not the fault of the developer. Block themes currently have no way to add dynamic values in their templates. Therefore, the only solution is to hotlink an image from a third-party site or add a static URL.

This is a not-so-trivial issue that has, at least in part, hampered the momentum of block theme development.

Ever since themes have been around, they have output data via PHP functions. When using block templates, everything is HTML and bits of JSON data. The dynamic parts are the blocks themselves. This works well enough for at least 90% (probably more) of scenarios.

Where theme authors run into trouble are the cases where there is no existing block or way of adding dynamic data inline. Some use cases include:

It is not so much that these things absolutely must be dynamic. Users are expected to edit the content via the site editor. However, the experience is not ideal if an image returns a 404 status when users have a different directory structure. Or when their theme has bits and pieces of English scattered throughout when using the Spanish translation. Before block themes officially land in WordPress, this must be fixed.

There is an open ticket slated for Gutenberg 11.8 that addresses this issue through a new Pattern block. Essentially, it would allow themes to output a pattern within templates.

<!-- wp:pattern {"slug":"namespace/pattern-name"} /-->

The reason this works is that patterns are defined via PHP. Theme authors can use internationalization functions like __(), print out the date with date_i18n(), or output an image URL with get_theme_file_uri().

This upcoming feature closed an earlier proposal for a standalone i18n block. It should also tackle the multiple ideas on an earlier issue for dynamic data in static HTML files. Another one for including images in block templates. And, I am sure a host of other tickets.

The push will likely happen because the upcoming default theme, Twenty Twenty-Two, needs it. Developers currently need to figure out how to show the default flying bird image on the homepage and add internationalized footer credit text.

Twenty Twenty-Two homepage design.

I like the concept here. Developers add the Pattern block within their templates. In the site editor, the pattern is shown and persists until a user makes a direct edit. Then, it behaves like any other set of blocks, and the content is no longer dynamic.

A side benefit of this feature is that it could also solve a duplicate code issue and allows theme authors to follow the DRY principle.

When creating templates or template parts, some theme authors duplicate the same content as user-selectable block patterns. Instead of having the code in two places, they can register it once as a pattern and call it within the template.

While the Pattern block is not officially merged yet, it looks to be the best solution to the dynamic content issue with block themes.

26 Oct 2021 11:24pm GMT

HeroPress: Investing In The WordPress Community

people with their hands in the middle of a circle together

Seven years ago HeroPress was started to inspire and give hope to WordPress community members, particularly those who might feel excluded from the mainstream WordPress community. It's always been our dream to go one step further, and provide tangible resources to people at all stages of their WordPress journey.

We've spent the last 9 months or so coming up with some great ideas, most of which you've seen us write about in recent posts. In order to give those resources the attention they need we're asking the WordPress community to help financially support them, investing back into that very same community.

The resources we've built can help people, and we want to keep them free for everyone to use. To do that, we need financial support for the projects maintenance and growth. By sharing the effort, we can work together to change individual lives, and eventually the world.

To help, go to the support page on the HeroPress Network site.

Thank you for being you.

26 Oct 2021 10:27am GMT