Fri 10 Apr |
|
The VirtueMart vmPopupLink function can come in handy when you need a simple information popup in your shop. An example could be a link to your data protection policy at registration time or on your product pages. VirtueMart vmPopupLink is a built-in native function which is used to call simple page popups with the minimum of coding It is is found in joomla_root/administrator/components/com_virtuemart/classes/htmlTools.class.phpand can be called in your pages or templates by vmPopupLink( $link, $text, $popupWidth=xxx, $popupHeight=xxx, $target='_blank', $title='', $windowAttributes='' ) The parameters are as follows -
So putting it all together we could insert the following code in our flypage template. <td colspan="3"><?php $link = $mosConfig_live_site .'/index2.php?option=com_content&Itemid=50&id=50&view=article '; $text = '<img src="'.$mosConfig_live_site .'/images/joomla/padlock2.png"><b>('.$VM_LANG->_('DATA_POLICY').')</b>'; $title = $VM_LANG->_('DATA_POLICY'); $popupWidth=400; $popupHeight=250; echo vmPopupLink( $link, $text,$popupWidth,$popupHeight,'_blank', $title, 'location=yes,screenX=600,screenY=600' ); ?></td> There is also a short format for writing the code where the parameters are fixed. N.B. The parameters must be entered in the order shown. <td colspan="3"><?php echo vmPopupLink( $mosConfig_live_site .'/index2.php?option=com_content&Itemid=50&id=50&view=article ', '<img src="'.$mosConfig_live_site .'/images/joomla/padlock2.png"><b>('.$VM_LANG->_('DATA_POLICY').')</b>',400,250,'_blank', $VM_LANG->_('DATA_POLICY'), 'location=yes,screenX=600,screenY=600' ); ?></td> Which produces this on our product pages - |
Last Updated on Wednesday, 22 April 2009 11:42 |