Articles are stored as complete HTML. The Content - PX Editor plugin only adds styles (CSS) and a small script for the lightbox and videos.
Loaded only when needed
Styles and script are loaded only on pages that contain PX Editor blocks. Other pages pay nothing. Size: about 2 KB of CSS and 2 KB of script (compressed). The lightbox library is downloaded only when a visitor first clicks an image.
Lightbox
For gallery images and images with Enlarge on click:
- Click an image to open it. Left and right arrow keys (or a swipe) change the image, Escape closes.
- The image's caption is shown at the bottom; without a caption, its alternative text.
- Closing the lightbox returns focus to the image that was clicked, which helps keyboard users.
- If the library cannot be loaded, clicking still opens the image file as a normal link.
Click-to-play video
A video block shows its poster with a play button. A click (or Enter while it has focus) replaces the poster with the player and starts the video. Nothing is loaded from YouTube or Vimeo before that.
Share buttons
Turn them on in the plugin Content - PX Editor, tab Share buttons. There are three ways to place them:
| How | Use it when |
|---|---|
| Add to every article (above, below, or both) | Every article should have them and nobody should have to remember. Can be limited to categories and extended to blog pages. |
| The Share buttons block in the editor | You want the buttons at a specific place inside an article. |
| Called from the template | A developer places the buttons in a template override. |
Each article shows buttons from one source only, in this order of priority, so they never appear twice:
- Buttons placed by the template (highest): the two sources below are hidden for that article.
- The Share buttons block in the article: the automatic buttons are hidden for that article.
- The automatic buttons (lowest).
The same source may appear more than once, for example automatic "above and below", or two blocks in one article.
Good to know:
- The buttons are plain links. The page loads no script from Facebook, X or any other network, and sends nothing to them until a visitor presses a button.
- Buttons: Facebook, X, LinkedIn, Pinterest (only for articles with an image), WhatsApp, Telegram, email, Copy link, and Share… (opens the phone's share sheet; shown only on devices that have one).
- There are no share counts: the networks no longer provide them.
- Open Graph tags: the plugin adds title, summary and image to article pages so that shared links look good. The image is the full-text image, the intro image, or the first image in the article (including a video poster). If an SEO extension already does this, turn off Add Open Graph tags.
For template developers:
- Place the buttons anywhere in an override:
echo Factory::getApplication()->bootPlugin('pxeditor', 'content')->renderShare($this->item); - Change the HTML of the buttons: copy
plugins/content/pxeditor/layouts/pxeditor/share.phptotemplates/<template>/html/layouts/pxeditor/share.phpand edit it.
Colours and your template
The styles follow the template: buttons use the template's primary colour, borders and secondary text use the Bootstrap colours when the template defines them. Checked on Cassiopeia.
To adjust the look, add CSS to your template's user.css. The main classes:
| Class | Block |
|---|---|
pxe-image (with pxe-left, pxe-right, pxe-wide, pxe-full, pxe-zoom) | Image with caption |
pxe-gallery | Gallery |
pxe-embed, pxe-video, pxe-audio | YouTube/Vimeo video, video file, audio file |
pxe-file | Download link |
pxe-callout (with pxe-callout-info, -success, -warning, -danger) | Callout |
pxe-button (with pxe-button-secondary, pxe-button-outline) | Button |
pxe-columns, pxe-column | Columns |
pxe-details | Collapsible section |
On phones
- Columns stack below 768px.
- Galleries show two columns below 576px.
- Images floating left or right move to the centre below 576px.
Blog pages and modules
The introduction of an article (before the Read more marker) is shown in category blogs and article modules. If a module or template prints content without running content plugins, the styles may be missing: turn on Load on every page in the Content - PX Editor plugin.