·

templating

Responsible Templating in Magento 2

Just because you can do anything in a template doesn’t mean you should. Some of you might already know the S.O.L.I.D way of programming. If you haven’t, it’s really interesting stuff if you want to be a better programmer. And besides that, the S.O.L.I.D principles can be found throughout Magento 2. The S in S.O.L.I.D read further ...

Creating Blocks in Magento 2

Just like Magento 1, Magento 2 has blocks. For those who don’t know what Magento blocks are: they are classes that template (parts) can use to gain some specific functionality. Blocks are used throughout Magento and are a core part of it’s design and will most likely also be a part of your customisations. So read further ...

A small SCSS function to help you with your colors

When I am templating a website, I use colors. A lot of those colors have different shades. For example, the color red can also come in dark- or in light red. Usually I solved this by creating different variables like this: Later on, I changed to sass maps and a corresponding function: Today I read further ...

get_template_part in WordPress with variables

As some of you might know, the get_template_part() -function of WordPress doesn’t allow you to pass variables. This can be quite annoying sometimes when you want to include a template several times, but each time with different parameters. Imagine a situation for example where you want to show 3 category blocks next to each other, that read further ...

How to keep your Magento themes organized

When is the last time you heard someone say: “Geez! Magento templates are really the bomb!”? If you’re still letting that question sink in, don’t worry, you’re not the only one. Magento templates are known for their overwhelming complexity and ugliness. Once you get the grasp of how the templating system with the local.xml  and the many, read further ...

WordPress: Templates in plugins

When you are creating a WordPress plugin, you might encounter the situation where you have to include a template in your theme. But you also want to give the users of your plugin the ability to make changes to this template, without overwriting the core template. The most intuitive way to provide this is by read further ...

Create post thumbnails in WordPress with wp_get_image_editor()

So the other day I had to implement a thumbnail of the featured image in WordPress. Little did I know about a little feature in WordPress called wp_get_image_editor, which is basically a tool that allows you to edit an image (resize and crop it), and save it as a new image.read further ...

How to add a custom template in Magento

Sometimes you have situations where you have to create a custom template for your Magento webshop. Take a homepage for example. These pages are always themed with slideshows, categories, advertisements, etc. The last thing you want is misuse the wysiwyg editor, bloating your CMS content with HTML and keep your fingers crossed that your client read further ...

Using SCSS to reduce Magento templating time

When creating Magento sites you often run into repeating (and boring) tasks like styling the shopping cart, the checkout progress, the login area of the user, etc… These pages are required yes, but they require a lot of CSS to be styled properly. Using a skeleton template or a boilerplate helps, but often you still read further ...