Toggle sidebar

Peter Anderson

Christian - Husband & Father - Web Developer

Creating a node programatically in Backdrop

For a Backdrop CMS site I'm currently working on, I needed to create a node programatically (i.e. via some PHP code, as opposed to the UI). Generally when I need to do something in Backdrop, I'll search for similar solutions in Drupal 7 and then migrate them over (Backdrop still has some catching up to do in the 'online help and tutorials' department; hence this blog post).

So I went looking for how to create nodes programatically in Drupal 7, and there were plently of results. The answer is basically to create an object or array of values (your 'node'), then run it through node_save()....

A 'Game of Thrones' Maths Puzzle

Four prisoners escape from the dungeons at King's Landing and head for the Wall; a distance of 700 leagues. The Maester travels 1 league in the first day, then each subsequent day, doubles the distance he travelled the previous day. The Whore travels 50 leagues each day. The Knight travels 80 leagues each day, and 20 leagues each night. The Squire travels 350 leagues the first day, then each subsequent day, travels half the distance he travelled the previous day.

Two days after the prisoners escape, the Mountain is sent out to hunt them down and kill them. He travels 100 leagues each day....

Introducing the first Backdrop challenge!

Block puzzle

Why

I love puzzles! The little metal ones you have to disassemble and re-assemble, escape rooms (though I've only ever done online point-and-click ones), even Mastermind. I recently saw videos online of a guy solving 'sequential discovery' puzzles. These are intricate devices that, for example, require you to find a hidden pin, then use that pin to push a button, which releases a drawer containing a code that you can use to open the puzzle and find the treasure. Watching these videos I had the thought that I could create something like that in Backdrop CMS. And with Backdrop's 5th...

The Evolution of a Site

Panda.id.au designs over the years

This site just got a bit of a makeover. I changed the layout and the theme, and I wrote about the how and the why in a Backdrop CMS Showcase article.

That got me thinking about the previous designs this site has had in the past. So I went hunting and found the different versions of my site over the years. The dates are approximate, generally the year that version was last used before I changed to the next one. The earlier versions I got from static HTML files I have backed up on my computer, the rest were from the Wayback Machine.

Creating a GitHub-like editing experience in Backdrop

I'm a big fan of the editing experience in GitHub. Through using GitHub over the last few years for my contributions to various open-source projects (mainly Backdrop CMS), I've learnt to write posts in Markdown and love the way GitHub makes it easy to add syntax-highlighted code snippets, insert images, etc. I wanted to replicate some of that functionality in Backdrop, so here's what I did...

Pages