Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Hot answers tagged

4

When developing, error reporting should be enabled. You'll see this: Notice: Undefined property: Joomla\CMS\Table\Content::$item Access the images like this: $images = $article->images;


3

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($...


3

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 /templates/TEMPLATE_NAME/html/com_content/category/blog_item.php /templates/TEMPLATE_NAME/html/com_content/article/default.php I would make a clone of existing view and then add code below ...


2

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) ->select(db->qn("item_id")) ->from($db->qn("#__fields_values")); // build all of the non-changing clauses for ...


1

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. $dom->loadHTML($item->...


1

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') { ...


1

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: <form> <fields name="main"> <fieldset name="basic" addfieldpath="/...


1

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.


Only top voted, non community-wiki answers of a minimum length are eligible