Introduction
Hi folks
I've been working on a couple of Perch site upgrades recently. One was a bit tricky because after a 2.8.34 upgrade, I wasn't able to login to Perch. Yikes! Normally, this might be a sessions problem on the server but the web hosting company told me this wasn't the case (and I could see session files being written).
The way round this was to upgrade the 2.8.34 site (on a staging sub-domain) to Perch 3.1.5 and copy that over the the live site. Problem solved!
I don't know if this was a server-related problem with the 2.8.34 upgrade or something else. However, the 3.1.5 upgrade fixed it.
News
Add-Ons
A Template Filter for Phone Numbers
The template filter uses Google’s library libphonenumber
for formatting and validating phone numbers.
Perch Font Awesome App
A Perch app to make it possible to add Font Awesome SVG icons via PHP or directly in a Perch template.
I've featured this app before and the link received a lot of clicks. So, I thought it was worth a reminder :-)
Code
Find or Create a Collection Item with Perch Import API
Find a Collection Item by a field. If not exists, create new.
Using the Perch Import API.
Miscellaneous
Create a responsive grid layout with no media queries, using CSS Grid
This link is not directly Perch related but I thought it was a great example describing how CSS Grid works.
Perch Documentation
How To Use perch_content_create
By default, Perch creates a region automatically when it is first used. It can then be configured from within the web interface to pick a template and set its options. This is the primary way to work with Perch regions. In some circumstances, it’s also useful to be able to programmatically create a region with
perch_content_create()
Sponsor
Help the Perchology Newsletter
Support the Perchology Newsletter with a small monthly donation. All contributions really help with the costs of this newsletter. Thank you to everyone who has donated, it's much appreciated.