I would have preferred to just suggest some touch ups to your snippet, but there is too much for me to address in your answer as a comment and I'd rather explain fully. Instead, I'll post this new answer which will review and clean up your assumed-working coding attempt for the benefit of you and future researchers.
You are declaring $images = json_decode($...
You would want to put this as a template override for com_content. Depending on whether you want it to appear on the category page or single article, the file would go
I would make a clone of existing view and then add code below ...
I don't see set() in the JTable docs. You also need to remember to re-encode the full column value before storing. The following is an untested snippet.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->from($db->qn("#__fields_values")); // build all of the non-changing clauses for ...
The solution to my question.
I think is valid:
<?php $images = json_decode($item->images);
<span itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
<link itemprop="url" href="<?php // Create new DOMDocument object.
$dom = new DOMDOcument;
// Load article text into DOMDocument.
Does such an event exist?
Core com_media component uses the same events as other core components: onContentBeforeSave, onContentAfterSave, onContentBeforeDelete and onContentAfterDelete. You'll need to check that context is com.media.file, e.g.:
public function onContentAfterSave($context, $item, $isNew)
if ($context !== 'com_media.file')
After some more googling and debugging, I figured it out. The trick was that I'm using a JForm and the file field can be accessed slightly differently. First you need to access the fields tag and then the file field itself (see the bold line below):
The form xml:
<fieldset name="basic" addfieldpath="/...
Thank you to @Lodder for providing a solution, very much appreciated.
@Lodder suggested my class name may be incorrect and said to try 'replacing class mod_CarouselInstallerScript with class mod_Rmg_carouselInstallerScript'.
I changed my class to mod_RRM_carouselInstallerScript which solved the problem.