• Sign In
    • Forgot your password?
    • Forgot your username?

K2 | The powerful content extension for Joomla! developed by JoomlaWorks

  • home
  • about
  • blog
  • documentation
  • extend K2
  • showcase
  • community
  • demo
Adding the missing features in Joomla
You are heredocumentation Tips & Tricks Imagen de campo adicional como enlace

Imagen de campo adicional como enlace

09 November 2013, 23:51 by Emanuel Rodríguez
in Tips & Tricks
  • Print/PDF
Si tiene un campo adicional tipo imagen y necesita mostrar un enlace directo a la imagen debe cambiar el código por defecto de K2. Para esto, puede insertar el siguiente código en el item.php (recuerde hacer un "template override"):
<?php 
$var = $this->item->extraFields->Image->value ;     
$var = preg_replace('/<img src="/',"",$var); 
$var = preg_replace('/" alt="Image" \>/'," ",$var); 
echo '<a href="' . $var . "TextOfLink" . "</a>" ; 
?>

Tags:

  • espanol ,
  • imagen ,
  • campo adicional ,
  • extrafield
Tweet
  • Contact us
  • Privacy Policy
  • License
  • K2 Downloads
  • K2 Metrics
  • K2 on GitHub
back to top
Copyright © 2006 - 2025 JoomlaWorks Ltd. All rights reserved. K2 is a joint project by JoomlaWorks & Nuevvo, released under the GNU/GPL license.
Joomla is a registered trademark of Open Source Matters, Inc. K2 is not affiliated with or endorsed by Open Source Matters or the Joomla Project.
designed by Nuevvo