Creating an article in 2.5 there is the new feature for Images and Links. At present there is not a way to provide a link for the image.So I set about to try and do this without hacking the Joomla core.As I saw it there were two things to do:1. Modify the file "article.xml" in "JoomlaRoot/administrator/components/com_content/models/forms". This I did and it showed up on the slider panel for Links and Images when creating a new article. Here is the change I made to article.xml: (Changes in Bold) <fields name="images"> <field name="image_intro" type="media" label="COM_CONTENT_FIELD_INTRO_LABEL" description="COM_CONTENT_FIELD_INTRO_DESC" /> <field name="float_intro" type="list" label="COM_CONTENT_FLOAT_LABEL" description="COM_CONTENT_FLOAT_DESC"> <option value="">JGLOBAL_USE_GLOBAL</option> <option value="right">COM_CONTENT_RIGHT</option> <option value="left">COM_CONTENT_LEFT</option> <option value="none">COM_CONTENT_NONE</option> </field> <field name="image_intro_alt" type="text" label="COM_CONTENT_FIELD_IMAGE_ALT_LABEL" description="COM_CONTENT_FIELD_IMAGE_ALT_DESC" class="inputbox" size="20" /> <field name="image_intro_caption" type="text" label="COM_CONTENT_FIELD_IMAGE_CAPTION_LABEL" description="COM_CONTENT_FIELD_IMAGE_CAPTION_DESC" class="inputbox" size="20" /> <field name="image_intro_link"
type="url"
validate="url"
filter="url"
label="Link"
description="Link Description" />
<field
name="spacer1"
type="spacer"
hr="true"
/>
2. Use a Template override for the file "blog_item.php" taken from folder "JoomlaRoot/components/com_content/views/category/tmpl
and moved to folder "/templates/site_name/html/com_content/category".
I made the following changes at about line 130 in file "blog_item.php".
(Changes in Bold)
<?php if (isset($images->image_intro_link) and !empty($images->image_intro_link)) : ?>
<a href="<?php echo htmlspecialchars($images->image_intro_link); ?>" target="_blank">
<?php endif; ?>
<img
<?php if ($images->image_intro_caption):
echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/>
<?php if (isset($images->image_intro_link) and !empty($images->image_intro_link)) : ?>
</a>
<?php endif; ?>
This did what I wanted which was to allow me to specify links for images when I added the image.
Now, I am left with the last step which I do not know how to do.
Is there a documented/proper method, similar to the Template Override that I did in step 2 that will move the modified
"ARTICLE.XML" out of the Joomla core and prevent loss of this enhancement when Joomla is upgraded ?.
Thanks,
Dave