OpenGraph assignments: choose which template each page uses
Describes OpenGraph 0.4.0.
An assignment connects a template to the pages that should use it, and says where each of the template’s placeholders gets its value. Once a published post is covered by an assignment, the image drawn from the template replaces the post’s own share image.
Where to find it
In the admin sidebar, open OpenGraph, then Assignments (/admin/open-graph/assignments). You need a role with the OpenGraph permission, the OpenGraph module enabled, and at least one template. Assignments apply to posts of the Publishing module.
Assignments: which template each module or group uses.
The assignments list
OpenGraph assignments lists every assignment. Each row says what it applies to (Whole Publishing module (default) or Group: and the group’s name), the Template: it uses, and how many of the template’s slots are wired, for example “2/3 slots wired”.
The most specific assignment wins: an assignment for a group overrides the module default for that group’s posts.
- Edit opens the assignment.
- The remove button deletes the assignment after Remove this assignment?. The template itself stays.
With no templates yet, the page points you to the Templates page and Assign template is greyed out.
Creating or editing an assignment
Assign template opens the Assign template for… dialog; Edit opens Edit assignment. Both hold the same fields.
- Applies to: Whole Publishing module (default) or A specific Publishing group. For a group, choose it under Group. A scope can hold only one assignment: if the one you pick already has one, the dialog says so, Save is disabled, and Edit the existing assignment takes you to it. When editing, the scope is locked. To move an assignment, remove it and assign the template again.
- Template: the template to use.
Wiring the slots
Wire template slots has one row per placeholder in the template. For each, choose:
- — Not wired —: the placeholder stays empty on the public image.
- One of the Variables the Publishing module offers, such as the post’s title, description, URL or featured image.
- Custom text…: a fixed text you type. It can contain
{{name}}and[[name]]placeholders too. - For an image slot, Custom (pick a media file): Choose opens the media library, or paste a media file’s UUID. The cross clears it. A web address of a remote image is not loaded, and the dialog warns that it would be left off the public card.
A template with no placeholders shows This template has no {{slots}} — nothing to wire.
Preview
Under Preview, pick a Group and a Post to see the image as it would be drawn for that post. Draft posts are marked (draft). Wired variables use the post’s data, custom values appear as typed, and unwired image slots show a stand-in. The preview appears once a template is chosen.
Create assignment (or Save when editing) saves it; Cancel closes the dialog without saving.
What it doesn’t do
- Assignments can only target the Publishing module as a whole or one of its groups. The page offers no per-post assignment.
- The page covers Publishing posts only. Other modules can use templates only if their developers wire them in.
- When the module is off, nothing is assigned, or drawing the image fails, the post keeps its own share image.