Requirements
- Omeka S 4.x
- PHP 8.1 or later
- The PHP GD extension. All images are rendered with GD. If GD is missing the module serves a 1x1 transparent PNG instead of failing.
- Imagick (optional). Drop shadows on image layers use an Imagick Gaussian blur when the extension is present. Without it, shadows are drawn as a solid offset rectangle.
- The Blog module (optional). Blog post cards are only available when it is installed and active.
The module bundles the Inter font (Regular and Bold), so no system fonts are required.
Installing
- Copy the
OgImagesfolder into your Omeka Smodules/directory. - Log in to the admin panel as a Global Administrator.
- Go to Admin > Modules and click Install next to OgImages.
Installation creates two database tables, og_template and og_site_template, and inserts one default template for each resource type: Default Item, Default Item Set, Default Media, Default Site, Default Page, Default Search and Default Blog Post. It also creates the cache directory modules/OgImages/data/og-image-cache if it does not exist.
After installing, an OG Images entry appears in the admin sidebar with Templates and Settings links, and public site pages start emitting Open Graph tags immediately. No theme changes are needed as long as your theme prints the headMeta() view helper in its layout, which the default theme and most themes do.
Checking it works
- Open any public item page on your site and view the page source.
- Look for
<meta property="og:image" content="https://your-site/og-image/item/123?site_id=1">. - Open that URL in a browser. You should see a 1200 x 630 PNG.
You can also paste a page URL into a social network's sharing debugger to see the card.
Upgrading
Copy the new version over the existing modules/OgImages folder, then visit Admin > Modules. If the module shows Upgrade available, click Upgrade. Consider flushing the image cache afterwards from Admin > OG Images so pages pick up any rendering changes.
Uninstalling
Uninstalling from Admin > Modules removes:
- the
og_templateandog_site_templatetables, including every template and site override you created; - the module's global settings (
og_images_enabled,og_images_cache_ttl,og_images_cache_dir,og_images_enabled_types,og_images_fonts).
Cached PNG files are not deleted. Remove the cache directory (by default modules/OgImages/data/og-image-cache, or the custom path you configured) by hand if you want to reclaim the space.
If the module cannot be uninstalled from the admin panel, drop the tables manually and remove the module directory:
DROP TABLE IF EXISTS og_site_template;
DROP TABLE IF EXISTS og_template;