• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Ben Barden

Products - Projects - Process

  • Ben Barden
  • Home
  • Music
  • Blogging in 2021
  • About

6th July 2015 by Ben Barden

Homepage relaunch

Now the miniblog has been running for a couple of weeks (here’s my intro post if you missed it), it’s time to think about whether it’s working.

Yes.

Well that was easy!

The main blog is now gone. Have a look at what I’ve done with my new homepage. I’ve pulled through links to some of my stuff from around the web – including recent posts from the miniblog, stuff I’ve liked on Instapaper, new tracks from Soundcloud, and a list of Instagram pics.

Instagram is manual, so I have to update it whenever I upload a new photo. I’ve yet to find a better way to do this as they don’t seem to have feeds. Why not?!

Having my blog as the homepage doesn’t make sense, as it’s not everything I do. I think this is a much better way to do it.

Filed Under: General Tagged With: feeds, instagram, instapaper, miniblog, relaunch, soundcloud, wordpress

5th July 2015 by Ben Barden

Setting up Twig in Laravel

Re-posted from my old blog

This week, I have been mostly trying… Laravel.

Trying a new PHP framework raises a few questions. What coding style does it use? How do you build models? What do templates look like?

When trying Laravel for the first time, I wasn’t keen on the Blade templating engine. So I decided to look for how to integrate Twig. One quick Google search later, and I found TwigBridge by Rob Crowe.

Following the instructions was simple enough. However, I think there was one thing missing. What do you name your template files so Twig can find them?

How to name Twig templates in Laravel

In Laravel, a Blade template for the “users” route would be called: users.blade.php

After a bit of experimenting, I found that the equivalent Twig template would be called: users.twig

This works out nicely in PhpStorm, as suddenly the file icon changed from a PHP file to a bit of green grass (maybe it looks better than a twig). And the code completion works. That’s much better than the last project I set up with Twig, which is on Zend Framework v1 and the files are named index.html.

Don’t forget to rename your base template to base.twig or similar. The Blade equivalent I created in the QuickStart guide was called layout.blade.php.

Comparing Blade and Twig templates

So, just for completeness, here’s a sample Blade template:

@extends('layout')
@section('content')
 @foreach($users as $user)
 <p>{{ $user->name }}</p>
 @endforeach
@stop

And here’s a Twig template:

{% extends "base.twig" %}
{% block content %}
{% for User in UserList %}
<p>{{ User.name }}</p>
{% endfor %}
{% endblock content %}

So far, I’m liking Laravel, but I’m much happier with Twig than Blade.

Filed Under: Tech Tagged With: blade, laravel, php, twig

5th July 2015 by Ben Barden

What’s the quickest way to set up a blog?

If you want to set up a personal blog, or a non-serious, non-business blog, by far the simplest way is to sign up for one of the following sites:

  • WordPress.com
  • Tumblr
  • Blogger

Business blogs are definitely worth setting up as a self-hosted WordPress blog on your own custom URL (i.e. yourname.com – rather than yourname.wordpress.com). This takes a bit longer to set up – and you’ll need to stay on top of updates to the software, themes, plugins etc.

If you’re happy with a blog that’s hosted on one of the above three platforms, they offer the fastest way to set up a blog.

Filed Under: General Tagged With: blogger, hosted, self-hosted blogs, tumblr, wordpress

4th July 2015 by Ben Barden

UX 101: hit Enter to submit

Usability testing is something I do a lot. Whether I’m testing what my technical team has built, or I’m using a website or app for the first time, I have some expectations when it comes to how the application behaves.

I’ve found there can be quite big differences between how the front-end of a site works, and how the admin screens work. The front-end is more important if you have a large userbase, but staff shouldn’t be ignored when it comes to UX.

One of the main things is being able to hit Enter to submit. This goes for simple search forms with a text field and a Submit button, or longer forms that are used for things like registration.

Hitting Enter is important particularly on long forms, as if you type a lot of information it’s possible to fill it in completely using the keyboard. Hitting Enter in the last field will submit the form.

It’s also handy if you can type into a search box and hit Enter to submit. This doesn’t always work however, as search forms are sometimes custom coded and the Enter key can end up doing nothing at all.

Allowing users to hit the Enter key to submit a form is a small but important benefit for making your forms user-friendly.

Filed Under: Tech Tagged With: enter key, forms, keyboard, typing

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 24
  • Go to page 25
  • Go to page 26
  • Go to page 27
  • Go to page 28
  • Go to Next Page »

Primary Sidebar

[instagram-feed]

Recent Posts

  • How to practise good etiquette in team updates
  • How improving the Okta SMS flow would reduce support requests
  • Flexible working in 2021
  • On encouraging others
  • Blogging mistakes – and how to avoid them

Archives

Categories

Handcrafted with on the Genesis Framework