I want to be able to add an image next to the title of an article (and be able to select the image for each article - not just a one and done setting). I modified the /administrator/components/com_content/models/forms/article.xml file by adding these fields at the top of the section:
<field
name="titleImage"
type="media"
label="Title Image"
description="Image that will be displayed next to the article's title." />
<field
name="spacer0"
type="spacer"
hr="true"
/>
This adds the parameter to the Edit Article page and lets me select an image.
I added this code to my theme's com_content/article/default.php page (inside the if ($params->get('show_title')) block):
<?php if($this->params->get('titleImage')){ ?>
<img class="titleImage" src="<?php echo htmlspecialchars($images->titleImage); ?>" alt="Title Image" />
<?php } ?>
The image is not appearing on the page. I'm new to Joomla so it may be obvious, but what am I missing?
Thanks!