Category: Development

Today a new feature was added to the Site Builder Uploaded Images widget, the ability to change the size and aspect ratio of the image you use.

The main purpose this was added was for users uploading images as full page headers. The default setting for the uploaded image was to be set to 'xxlarge' which is 512px, but because the width of a page is usually wider than that the result would be grainy images that were less than ideal especially when the banner is the main theme for the page.

This new system allows a larger image size to be selected so a better quality image results. Check out the BEFORE and AFTER images below.

The BEFORE image was blurry because it was a small image stretched into a large container. The AFTER image is close to the correct size for the container so is much clearer.

A small new feature, but useful for anyone using the Upload Images widget for the Site Builder system.

What I'd like to do is a series on how to go about solving problems. If you read the forums you will see many instances of questions being asked, then the answer being something like "It's fixed in the next release, so update".

Not all of the code in this series will always be current as better ways of doing things always come up.

What I want to look at here is the base process that you, me or anyone goes through in order to solve a problem.

I'm hoping it will help developers new to Jamroom or new to developing start to get some patterns that they can use to solve their own problems. Which would lead to developing neat stuff.

So here goes:

First thing to remember is: It's not the problem in particular that we're looking at, but rather the methods we use to solve the problem.

Second thing to remember is: There is always more than one way to solve a problem.

This problem comes to us from this forum thread:https://www.jamroom.net/the-jamroom-network/forum/jamroom-developers/14693/in-user-names

The issue is: That albums with foreign characters (non English) in the url were causing the album to not display. What we need to figure out is Why?.

So the steps are:

figure out where we need to look

figure out what is not working

find a way to make it work

implement that solution.

In this case:

Where to look was the item_album.tpl file

What was not working was the wrong thing was being searched for

To make it work we needed to get the search term into the same format as it was in the database.

We applied the same code that was used when inserting to the database to the search term.