As many things with Backlight 2, the search page can be customized using CSS and phplugins. In this example, I removed the section headers and matching albums, and added a result count: Interested? Follow along and I show you how to get there! Hiding Album and Photos sections One regular request is to hide the […]
Redirect to https for WordPress
If your site already has an SSL certificate, you have most likely enabled automatic redirect from http to https in the Backlight 2 admin panel: Unfortunately, this redirect doesn’t work for WordPress based pages. But there is an easy fix for that. Just add following few lines at the beginning of your .htaccess file for […]
Page specific PHP code
Phplugins is very powerful as it can be used to customize your Backlight 2 based site to an extend not possible with the Backlight admin interface. Sometimes, it is not desired, that such a customization targets the entire site, but only a single page or a group of pages. In this short post, I show […]
Improving Navigation of Albums and AlbumSets
To navigate back from an album or an album-set to the parent album-set, I use either bookmarks or a keyboard shortcut (cmd-[ on my Mac). Or on my phone, it is a simple swipe from the left border of the LCD to the middle of the screen. But some users might be more familiar with […]
Adding radio buttons and drop-down lists to forms
Since Backlight was introduced, once in a while users asked for more advanced form features such as radio buttons and drop-down lists. Backlight’s contact form editor is easy to use, but only supports text input. These forms are really just intended for simple contact forms. For more advanced forms, it is recommended to use WordPress […]
Get recent blog posts outside of WordPress pages
On my photography site, I display a list of the last 5 blog posts in the footer on all pages. I use the rss feed to get the most recent posts outside of the wordpress environment. This is how I do it using phplugins: And then I can call $this->dlp_get_latest_blog_posts(10, ‘my-link’) wherever I would like […]
Better use of metadata for single image pages
Backlight2 provides the option to access certain image metadata using `Metadata One`, `Metadata Two` and the `Tokens` field. This limits creators who need to access more metadata to provide additional information to the user. Using additional metadata might increase SEO as well. In this example, I use `Metadata One` which can be found in Backlight […]
Customizing single-page view
The single-page view is a bit of a neglected child. Its main purpose is to provide a static link to an image that can be easily shared on social media. But there is more! With Backlight 2 and later, the internal classes photo and album are exposed now.
Adding breadcrumbs to non-gallery pages (updated August 2020)
Updated August 2020: I now use the newer Schema.org vocabulary for the breadcrumbs structure instead of the now obsolete data-vocabulary.org. For consistency reasons with my other phplugins tips&tricks, I renamed the my_crumb() helper function. It is now called dlp_my_crumb(). Updated August 9, 2020: Added support for backlight/search. Backlight provides the option to use breadcrumbs on […]
Using Markdown with Phplugins
It couldn’t be simpler than that: Or you can have text that spans several lines: Or you can assign text to a variable and then output that content using the Markdown parser: This last examples shows as well how you could add text to an already existing variable. Please note that this will not work […]