Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are article intro images in J, since 1.7.5 and now in latest 2.5.3 what you need is change the defaults for component_content, </p> <p>you can do it 2 ways, editing views in yourinstall/components/com_content/views/</p> <p>or use template overrides , you first need to know if your template IS using overrides otherwise if you edit component views in the component itself you will not see changes.</p> <p>to verify this , go to site_name/templates/template_name/html folder and check if there is folder name com_content , </p> <p>if that is the case than your template is using overrides and any edits should be done trough there not through component</p> <p>now to the actual code </p> <p>this is in components\com_content\views\featured\tmpl\default_item.php ( THIS I DEFAULT FRONTPAGE ARTICLE VIEW) </p> <pre><code>&lt;?php if (isset($images-&gt;image_intro) and !empty($images-&gt;image_intro)) : ?&gt; &lt;?php $imgfloat = (empty($images-&gt;float_intro)) ? $params-&gt;get('float_intro') : $images-&gt;float_intro; ?&gt; &lt;div class="img-intro-&lt;?php echo htmlspecialchars($imgfloat); ?&gt;"&gt; &lt;img &lt;?php if ($images-&gt;image_intro_caption): echo 'class="caption"'.' title="' .htmlspecialchars($images-&gt;image_intro_caption) .'"'; endif; ?&gt; src="&lt;?php echo htmlspecialchars($images-&gt;image_intro); ?&gt;" alt="&lt;?php echo htmlspecialchars($images-&gt;image_intro_alt); ?&gt;"/&gt; &lt;/div&gt; &lt;?php endif; ?&gt; </code></pre> <p>all you would need to do is wrap a element around IMG tag with readmore link like this </p> <pre><code>&lt;a href="&lt;?php echo $this-&gt;item-&gt;readmore_link; ?&gt;"&gt; &lt;img &lt;?php if ($images-&gt;image_intro_caption): echo 'class="caption"'.' title="' .htmlspecialchars($images-&gt;image_intro_caption) .'"'; endif; ?&gt; src="&lt;?php echo htmlspecialchars($images-&gt;image_intro); ?&gt;" alt="&lt;?php echo htmlspecialchars($images-&gt;image_intro_alt); ?&gt;"/&gt; &lt;/a&gt; </code></pre> <p>DO NOT forget that if there is template override for com_content you wold need to edit the featured/default_item.php inside it </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload