Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JP Simple Open Graph

The dead-simple Open Graph + Twitter Card plugin for Joomla. No setup. No tricks. It reads the tags straight from Joomla — including the article's intro image.

Why this exists

Making simple Open Graph tags in Joomla has always been more fiddly than it should be. Every plugin out there wants to be a full-blown SEO suite, with a dozen tabs and a manual to match. But 95% of sites just want the basics done right:

  • the page title as the title,
  • the meta description as the description,
  • and the article's intro image as the shared image.

Somehow there was no plugin that just did that — most surprisingly, no plugin that simply takes the intro image (the one you already set under Images and Links → Intro Image) and uses it as the Open Graph image. So here it is.

What it does

Install it and it works. On every page it outputs a clean, valid set of Open Graph and Twitter Card tags, all pulled from Joomla's own data:

Tag Source
og:title · twitter:title Page title
og:description · twitter:description Meta description (falls back to the intro text), truncated to 200 characters
og:image · twitter:image The article's intro image (image_intro, falling back to image_fulltext)
og:type article on article pages, website everywhere else
og:url The current page URL
og:site_name Site name
twitter:card summary_large_image when there's an image, otherwise summary

Requirements

  • Joomla 4.4+, 5.x or 6.x
  • PHP 8.1+

Installation

  1. Download the latest plg_jpsimpleopengraph-*.zip from the Releases page.
  2. Go to System → Install → Extensions.
  3. Upload the ZIP.

That's it. The plugin is enabled and working immediately — there is nothing to configure to get started.

Optional settings

Two optional fields under System → Plugins → System - JP Simple Open Graph:

Setting What it does
Default image A fallback image for pages without an intro image (front page, category lists, …).
Twitter site Your @handle, emitted as twitter:site.

How it works

A system plugin that listens to Joomla's onBeforeCompileHead event and injects the tags into the document <head> just before it renders:

  1. On a com_content article view it loads the article's images field and reads image_intro (falling back to image_fulltext), cleaning Joomla's #joomlaImage://… media fragment off the path.
  2. It resolves the article id even for Single Article menu items, where the id lives in the menu link rather than in the SEF URL.
  3. The title comes from the page title; the description from the meta description (with the intro text as a fallback), normalized and truncated to a safe 200 characters.
  4. Image paths are turned into absolute URLs, so the tags are always correct regardless of SEF, subfolder or multi-language setup.

No overrides, no layout hacks, no database writes, no external services, no JavaScript.

Building from source

The plugin source is self-contained — the manifest lives at the repo root. To build a ZIP:

zip -r plg_jpsimpleopengraph.zip jpsimpleopengraph.xml src services language

…and install that file through the Joomla installer.

License

GNU GPL v2 or later

About

A Simple Joomla plugin that adds Open Graph to your pages usign Intro image as image.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages