Username or Email
Forgot your password?
Forgot your username?
Or sign in with your account on:
K2 | The powerful content extension for Joomla! developed by JoomlaWorks
The 'de facto' content solution for Joomla! professionals!
Extra field image type as link
19 January 2013
Tips & Tricks
If you have an image type extra field and need to display a link directly to the image you must strip the default code that K2 uses to insert the image into it's foreach loop. You can insert this directly into your item.php override file.
$var = $this->item->extraFields->Image->value ;
$var = preg_replace('/<img src="/',"",$var);
$var = preg_replace('/" alt="Image" \>/'," ",$var);
echo '<a href="' . $var . "TextOfLink" . "</a>" ;
Be the first to comment!
Join the K2 Expert Companies list
back to top
Copyright © 2006 - 2015
All rights reserved. K2 is a joint project by JoomlaWorks Ltd. &
Nuevvo Webware P.C.
, released under the
is a registered trademark of Open Source Matters, Inc. JoomlaWorks/Nuevvo are not affiliated with or endorsed by Open Source Matters or the Joomla! Project.