joomla - Make image popup in content article automatically -
i want make content plugin in joomla, in whenever insert image automatically converts popup.
for use jcemediapopup, uses class="jcemediapopup"
i wants, whenever user insert image in article, of our plugin <img src
line coverts <img class="jcemediapopup" src=
so image become popup.
any !
unless want write plugin this, can in template override, eg. apply e content article:
- copy /components/com_content/views/article/tmpl/default.php /templates/yourtemplate/html/com_content/article/default.php
- where article content echoed (around line 187), apply following:
change
<?php echo $this->item->text; ?>
to like
<?php echo preg_replace('/<img src="([^"]+)" ([^>]*)>/', '<a href="\1"><img src="\1" class="jcemediapopup" \2></a>',$this->item->text); ?>
you might have tweak regexp if images contain class-tag ...
Comments
Post a Comment