jAlbum Bridge reborn for WordPress’ new Block Editor

In October 2018, when I released jAlbum Bridge I had no idea WordPress will replace its post editor (TinyMCE) with a completely new one (Gutenberg, later Block Editor) in two months. Unfortunately, the new editor was not backwards compatible, and even more unfortunately they failed to provide comprehensive documentation at that time.

I must admit the new editor is lightyears better in terms of user-friendliness and its WYSIWYG (“what you see is what you get”) nature. Nevertheless I finally failed turning the plugin Gutenberg-compatible. It was really frustrating; I’ve spent so much time on developing a deprecated piece of software. The plugin has received negative reviews for being “abandoned” deservedly, and even WordPress warned us they will close the plugin if we fail to update it. Finally Anders gave me hand by kickstarting the development, which was a big help.

In the new plugin it’s not only the user interface changed but under the hood all the transitions were rewritten too to make them smoother, and some new features were added as well. For instance there’s a new transition – zoom – and a few new sort options too. Editing the raw HTML title and image caption templates got removed - which was a bit techy anyway -, so you can only choose from the predefined designs now.

The new WordPress also allows the blocks to be wider than texts, which looks great with galleries – so jAlbum bridge 2+ allows this option too. Use the alignment button above the block! (Works only in themes that support it.)

Usage

The first step is installing the plugin through the Admin panel of your WordPress site.

Naturally, you can also download and place the plugin right into the /wp-content/plugins folder of your WordPress directory.

Search for “jalbum-bridge” ...

... install ...

... and “Activate”.

Back in the post editor when you click the (+) (add block) button “jAlbum Bridge” will be listed under the “Embeds” category. You can also start typing its name to find it quicker.

In the Inspector Panel enter the URL of the album’s top level page and the projector will immediately appear. You can use site root relative (e.g. /albums/2020) and absolute address.

If you want to show only a specific folder, enter the relative path to the folder in the Settings / Initial Folder box below (e.g. path/to/folder).

Most settings are self-explanatory – I hope – and the behavior is immediately reflected in the editor, which makes it so much easier to get the desired look than before.

One setting though is not applied in the editor: no links to the real album is generated. I just wanted to avoid driving users crazy who just want to select a block and they end up in the album instead, effectively leaving the editor.

By default the projector will use the Slideshow / Slide transition, but I encourage you to experiment with different transitions. Once ready press Preview to check out the final look!

Note to existing users

As WordPress’ new Block Editor has a fundamentally different way of storing the projector settings, the projectors created with earlier versions are not automatically converted to blocks. They will still appear as short codes – but no settings window is available like before. This way your old projectors will continue to work, but it probably worth adding them again as blocks.

If it’s only the jalbum bridge held you back from the new Block Editor, now it’s time to move on and enable the new interface – you won’t regret.

If you still want to keep with the short-code version here’s a small cheat sheet for the parameters:

Attribute Meaning Default
albumurl The absolute or site-root relative path to the album (mandatory).  
align The projector width: center|wide|full, where "center" has the same width as the text content. center
ar Aspect ratio – width / height – as percentage, e.g. 80 (depends on type)
captiontemplate

The template for the image caption in HTML format. Available variables:

  • ${label} – File name without extension
  • ${name} – File name
  • ${fileDate} – File modified date
  • ${comment} – Comment added in jAlbum
  • ${title} – Title
  • ${fileSize} – File size
  • ${category} – Category: image|audio|video|other
  • ${keywords} – Keywords added in jAlbum
  • ${rating} – Rating added in jAlbum
  • ${location} – GPS location
(empty)
captionplacement The horizontal / vertical placement of the image caption, e.g. right middle center bottom
captionstyle The color of the image caption: white|light|transparent|dark|black dark
depth The depth of album folder levels to gather images from. 1 = the top level only (or the given folder). The discovery will stop when the number of images reaches the required number of images. 2
disablelinks By default the projector will have links to images in the real album. By setting this attribute to true you can avoid generating these links. false
folder The initial folder the gathering of images should start. Leave empty for the top level album page! (empty)
gap Taken into account with grid type layouts: grid, masonry, mosaic, strip. Possible values: none|thin|small|medium|large|xlarge none
include The type and order of items to gather: images|folders,images|images,folders|folders images
layout

In case of “slideshow” types this is the maximum number of images to gather. In case of “carousel” this can’t be bigger than 15. With grid-like layouts:

  • gridgrid-2-2|grid-3-2|grid-4-2|grid-5-2|grid-3-3|grid-4-3|grid-5-3|grid-4-4|grid-5-4|grid-5-5
    (default: grid-4-3)
  • masonry – number of cards: 5–100
    (default: 17)
  • mosaicmos-1-3|mos2-3|mos-1-2-4|mos-1-5
    (default: mos-1-3)
  • strip – number of cards: 2–10
    (default: 6)
(depends on type)
ordering Ordering of the images gathered original|date|date-reverse|name|name-reverse|size|size-reverse|random original
slideshowdelay The length of time between transitions (= pause time) in milliseconds (depends on transition)
skipduplicates The projector is capable of skipping duplicate images (e.g. if the same is used as folder thumbnail). You can disable this behavior by setting this attribute to false true
titletemplate

The template for the album caption in HTML format. Available variables:

  • ${label} – File name without extension
  • ${name} – File name
  • ${comment} – Comment added in jAlbum
  • ${title} – Title
  • ${keywords} – Keywords added in jAlbum
(empty)
titleplacement The horizontal / vertical placement of the title, e.g. left middle center top
titlestyle The color of the album title: white|light|transparent|dark|black white
type Projector type: slideshow|grid|masonry|mosaic|strip slideshow
transitionspeed Length of transition in milliseconds (type = slideshow only): 0–10000 (depends on transition, typically 1000)
transition Transition type (type = slideshow only): crossfade|zoom|kenburns|stack|slide|swap|carousel|flip| book|cube|coverflow slide

Here’s how such a short code looks like:
[jalbum_bridge albumurl="/album/Lucid%20development" include="images" /] – just add the necessary parameters and you are good to go.

I hope you’ll find this litle tool a nice and useful addition to your WordPress site. If you liked it please honor my efforts by giving a somewhat better rating than today on the plugin’s page. :)

If you happen to get stuck we are here to help in the jAlbum Bridge forum.

/Laza

Sign in to post
Add your comment
Post comment
Laca Molnar

Laca Molnar 24 zile în urmă

Probably CORS violation (Cross Origin Request), that is the wordpress site is not allowed to pull content from the album site. The solution is adding an exception in the album sites's root (public_html) / .htaccess file:
Header set Access-Control-Allow-Origin: "http://www.your-wordpress-site.com"
Header set Access-Control-Allow-Origin: "https://www.your-wordpress-site.com" env=HTTPS

couvaras

couvaras 24 zile în urmă

Does not work. Blank page.

Laca Molnar

Laca Molnar acum 2 luni

@jrendant: No, this is not a complete skins, just a projector - it doesn't even show all images in the album.

jrendant

jrendant acum 2 luni

Can i select and sell images from this module?