Welcome to the Gutenberg Editor

Default page when first installing Gutenberg

The default content is the Welcome block above (which you can’t seem to put anything above – oddly) and the blocks below starting with the visual “Of Mountains & Printing” block.

Of Mountains & Printing Presses

The goal of this new editor is to make adding rich content to WordPress simple and enjoyable. This whole post is composed of pieces of content—somewhat similar to LEGO bricks—that you can move around and interact with. Move your cursor around and you’ll notice the different blocks light up with outlines and arrows. Press the arrows to reposition blocks quickly, without fearing about losing things in the process of copying and pasting.

What you are reading now is a text block the most basic block of all. The text block has its own controls to be moved freely around the post…

… like this one, which is right aligned.

Headings are separate blocks as well, which helps with the outline and organization of your content.

A Picture is Worth a Thousand Words

Handling images and media with the utmost care is a primary focus of the new editor. Hopefully, you’ll find aspects of adding captions or going full-width with your pictures much easier and robust than before.

Beautiful landscape
If your theme supports it, you’ll see the “wide” button on the image toolbar. Give it a try.

Try selecting and removing or editing the caption, now you don’t have to be careful about selecting the image or other text by mistake and ruining the presentation.

The Inserter Tool

Imagine everything that WordPress can do is available to you quickly and in the same place on the interface. No need to figure out HTML tags, classes, or remember complicated shortcode syntax. That’s the spirit behind the inserter—the (+) button you’ll see around the editor—which allows you to browse all available content blocks and add them into your post. Plugins and themes are able to register their own, opening up all sort of possibilities for rich editing and publishing.

Go give it a try, you may discover things WordPress can already add into your posts that you didn’t know about. Here’s a short list of what you can currently find there:

  • Text & Headings
  • Images & Videos
  • Galleries
  • Embeds, like YouTube, Tweets, or other WordPress posts.
  • Layout blocks, like Buttons, Hero Images, Separators, etc.
  • And Lists like this one of course 🙂


Visual Editing

A huge benefit of blocks is that you can edit them in place and manipulate your content directly. Instead of having fields for editing things like the source of a quote, or the text of a button, you can directly change the content. Try editing the following quote:

The editor will endeavor to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.

Matt Mullenweg, 2017

The information corresponding to the source of the quote is a separate text field, similar to captions under images, so the structure of the quote is protected even if you select, modify, or remove the source. It’s always easy to add it back.

Blocks can be anything you need. For instance, you may want to add a subdued quote as part of the composition of your text, or you may prefer to display a giant stylized one. All of these options are available in the inserter.

You can change the amount of columns in your galleries by dragging a slider in the block inspector in the sidebar.

Media Rich

If you combine the new wide and full-wide alignments with galleries, you can create a very media rich layout, very quickly:

Accessibility is important — don’t forget image alt attribute

Sure, the full-wide image can be pretty big. But sometimes the image is worth it.

The above is a gallery with just two images. It’s an easier way to create visually appealing layouts, without having to deal with floats. You can also easily convert the gallery back to individual images again, by using the block switcher.

Any block can opt into these alignments. The embed block has them also, and is responsive out of the box:

You can build any block you like, static or dynamic, decorative or plain. Here’s a pullquote block:

Code is Poetry

The WordPress community


If you want to learn more about how to build additional blocks, or if you are interested in helping with the project, head over to the GitHub repository.


Thanks for testing Gutenberg!

👋

WordPress > Gutenberg

Gutenberg (the default in WordPress 5.0) is the new WordPress Editor.

The major differences:

  • edit in Blocks (visual drag and drop blocks much like drag-and-drop web editors like Wix or Squarespace)
  • Tables – this always used to be a pain

More: https://www.smashingmagazine.com/2018/08/complete-anatomy-gutenberg-wordpress-editor/

See this example post: Welcome to the Gutenberg Editor

Notes:

  • Categories is a lot bigger. But, instead of being alphabetical it seems to be randomly ordered

Old
http://www.snowcrash.eu/wp-content/uploads/2018/09/Screen-Shot-2018-09-26-at-10.40.16-AM-257x300.png 257w" sizes="(max-width: 268px) 100vw, 268px" />

New
http://www.snowcrash.eu/wp-content/uploads/2018/09/Screen-Shot-2018-09-26-at-10.41.05-AM-98x300.png 98w" sizes="(max-width: 269px) 100vw, 269px" />

  • The classic WordPress editor is also just a block which you can drop in anywhere on the page

Dislikes:

  • The default entrypoint is Blocks. So, if you’re typing every time you hit Enter you get a new Block. I wanted to put in some bulletpoints and had to create a new block
  • It’s not clear in the new block how to add bulletpoints
  • Now that this post is using Blocks I can no longer see how to add images (e.g. the above images were before using Gutenberg). Now, I can’t see how to add an image!
  • You have to select a different tab (i.e. Document) to add Categories
  • You have to hit Publish twice to Publish
  • The Update button stays blue after you’ve Updated your post. i.e. if you return to the page how do you know if the version you’re working on is the latest version or not. I end up just clicking it before I close the page just to be sure.

Personally, I find the disconnect so big (I’ve got a ton of other stuff to work on let alone spend half an hour working out how to do simple things like:

  • add a new line
  • insert an image
  • change text to Preformatted

that I’ve gone back to the Classic Editor.

WordPress Plugin – an example of bad programming

When you have to break out a debugger to try and figure out why an obvious modification to a piece of third party code isn’t working it’s usually down to bad code. Here’s the problem:

I was trying to add a submenu page to an existing WordPress menu.

Unfortunately, the developer had decided to write a convenience wrapper around some of the existing WordPress Add Menu functionality. Whilst a neat idea (you simply used a render function to that would parse the page name to call the function that rendered the content), they had managed to shoot themselves in the foot by hard-coding the page names in this render function.  E.g. in this render function you had:

What it meant was you had to basically step through the code to find out why things weren’t working.

Open Source web frameworks for 2016, 2017, 2018 and beyond

As an Open Source developer specializing in PHP frameworks like WordPress, Drupal, CodeIgniter and Symfony I’m always keen to know where to focus my efforts on new technologies.

But how can you predict where a web technology is going?

This is where Google Trends comes to the rescue. Here are some graphs of interest (in terms of searches for the technology) of new and existing Open Source web frameworks.

One caveat – a search for a term covers a lot of potential use cases such as end users wanting to find out more or developers searching for more information. A higher search number does not mean higher pay rates but it does mean there is a global interest in the technology.

Firstly, some CMSs: Drupal, WordPress, Joomla, TYPO3

WordPress is clearly more popular (which is understandable given its dominance). However, interestingly, Drupal is clearly on a downward trend. Anyone care to explain why?

I did have a look at other CMS’s such as OctoberCMS and PageKit but these did not even feature on the graph hence the omission. If anyone wanted a graph of up-coming systems perhaps I could do a separate chart.

Then, some frameworks: Yii, Symfony, Laravel, Zend, CodeIgniter

Some key takeaways – Laravel is going through the roof!
And Zend, which hit a peak in 2009, is clearly dropping off the radar. CodeIgniter, which had a peak in 2013, still has a strong interest and is in second place.

It would be interesting to expand on these graphs. Any suggestions on other frameworks or time periods to focus on?

WordPress – crap code

I’ve just been digging through query.php trying to fix a WordPress problem.

And the code I see is staggeringly bad. Yet this is core code.

e.g. take a look at get_posts(), pages upon pages of if statements. Utterly unreadable and there is no way to figure out how a change might cascade down the code.

I ran the code through a debugger. After staggering through the hundreds of lines of if statements I found WordPress was calling the function a 2nd time. So, not only is it incredibly long and incomprehensible. It gets called multiple times.

 

MarsEdit

Testing out MarsEdit.

MarsEdit

This has some great reviews and a free-to-try model. Anything has got to be better than using the web admin panel so I thought I’d give it a go.

First thing I got asked was whether I wanted to use HTML or Rich Text. Which puzzled me.

I’m publishing to the web so I chose HTML.

Uploading images gives you two options – upload Now or With Post. With Post seems to be less blocking to your workflow.