web design, England, Britain, UK, belgium
 
Ulti Clocks content

Using the VitueMart 1.1 Popup (vmPopupLink function)

GJC Web Design Joomla & VirtueMart how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help

A collection of help articles and coding examples for Joomla & Virtuemart

Belgium, VirtueMart & Joomla Web Design England UK Britain & Germany

Joomla, VirtueMart, how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help sand 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 checkout pages.
pre, vmpopuplink, data, link, policy, xml, title, html, lang, virtuemart, joomla, site, text, mosconfig, images, php, com, live, src, blank, png, popupwidth, popupheight, img, content, location, div, code, index, itemid, option, padlock, article, screeny, parameters, yes, language, screenx, view, target

Home Joomla - VirtueMart Joomla & VM How To's Using the VitueMart 1.1 Popup (vmPopupLink function)

Fri

10

Apr

Using the VitueMart 1.1 Popup (vmPopupLink function)

  • Joomla 1.5
  • VirtueMart 1.1

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 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.php
 
and 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 -
  • $link is the url you wish to link to. This can be on your local website or external.
    If you want to call just the content of a page (without your headers, navigation and footers) then use the "index2" form in your url. e.g.
     
    $link=$mosConfig_live_site .'/index2.php?option=com_content&Itemid=74&id=49&lang=de&view=article'; 
     
  • $text is the link text that you will see on your page. This can also include images.
    Also in a multi language site you can take the text from your language files e.g. $VM_LANG->_('DATA_POLICY') A code example could be so -
     
    $text = '<img src="'.$mosConfig_live_site .'/images/padlock2.png"><b>('.$VM_LANG->_('DATA_POLICY').')</b>'; 
     
  • $popupWidth & $popupHeight are the size of the desired popup in pixels (px not needed).
     
    $popupWidth=400;
     
    $popupHeight=250; 
     
  • $target would normally be _blank, so $target='_blank';
  • $title is the link title attribute and can also be taken from the language files. e.g.
     
    $title=$VM_LANG->_('DATA_POLICY');
     
  • $windowAttributes can also be included such as -
    $location='location=yes,screenX=600,screenY=600';


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 -
VirtueMart vmpopuplink data protection


Add this page to your favorite Social Bookmarking websites
Digg! Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Live! Facebook! Slashdot! Technorati! StumbleUpon! Spurl! Newsvine! Furl! Fark! Yahoo! Netvouz! Mister-Wong! RawSugar! Ma.gnolia! Squidoo! DZone! Swik!
Last Updated on Wednesday, 22 April 2009 11:42 Read : 3702 times
 

Add your comment

BoldItalicUnderlineStrikethroughSubscriptSuperscriptEmailImageHyperlinkOrdered listUnordered listQuoteCodeHyperlink to the Article by its id
Very HappySmileWinkSadSurprisedShockedConfusedCoolLaughingMadRazzEmbarrassedCrying or Very SadEvil or Very MadTwisted EvilRolling EyesExclamationQuestionIdeaArrowNeutralMr. GreenGeekUber Geek
Your name:
Subject:
Comment:

Latest Articles

Paypal Donation

If you use this module on your site please donate a small amount.
Any donation amount appreciated.

VM Live Product Search

Recommended Reading

For those interested in extending there knowledge of Joomla! & VirtueMart Packt Publishing has an excellent range of help & how to books.
Listed below are some I can recommend.
Simply click on the images to be taken directly to their web shop.

Learning Joomla! 1.5 Extension Development Learning Joomla! 1.5 Extension Development
by Joseph L. LeBlanc.
Read the review
Joomla! E-Commerce with VirtueMart Joomla! E-Commerce with VirtueMart
by Suhreed Sarkar.
Read the review
Joomla! Web Security Joomla! Web Security
by Tom Canavan.

Mastering Joomla! 1.5 Extension and Framework Development Mastering Joomla! 1.5 Extension and Framework Development
by James Kennard.

Joomla! Template Design: Create your own professional-quality templates with this fast, friendly guide Joomla! Template Design: Create your own professional-quality templates with this fast, friendly guide
by Tessa Blakeley Silver.

GJC Web Design Joomla & VirtueMart how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help

A collection of help articles and coding examples for Joomla & Virtuemart

Belgium, VirtueMart & Joomla Web Design England UK Britain & Germany

Joomla, VirtueMart, how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help



Using the VitueMart 1.1 Popup (vmPopupLink function)



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 checkout pages.


pre, vmpopuplink, data, link, policy, xml, title, html, lang, virtuemart, joomla, site, text, mosconfig, images, php, com, live, src, blank, png, popupwidth, popupheight, img, content, location, div, code, index, itemid, option, padlock, article, screeny, parameters, yes, language, screenx, view, target