Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 4, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Documentation  »  HTML  »  URL linking

4.7. URL linking

Fields can be made 'clickable' in the display using ['URL'] variable. Primary examples follows:

Example 4-30. Simple URL examples

$opts['fdd']['col_name']['URL'] = 'http://$link'; 
$opts['fdd']['col_name']['URL'] = 'mailto:$value'; 

Note that the following are available as variables for usage in ['URL']:

  $key -- key field for record
  $name -- name of the field
  $value -- value of the field
  $link -- not modified raw value
  $css -- CSS class name
  $page -- this HTML page
  $url -- CGI variables

To open a link in a new web browser window use:

Example 4-31. URL target example

$opts['fdd']['col_name']['URLtarget'] = '_blank'; 

To display alternative link text use:

Example 4-32. URL display example

$opts['fdd']['col_name']['URLdisp'] = 'Launch Page'; 

Old 3.5 behaviour is also supported via ['URLprefix']. It will prepend string before if it is not already present there. Variable ['URLpostfix'] similary to ['URLprefix'] will append string after if it is not already present there.

Example 4-33. URL prefix and postfix

$opts['fdd']['col_name']['URLprefix'] = 'mailto:'; 
$opts['fdd']['col_name']['URLprefix'] = 'http://'; 
$opts['fdd']['col_name']['URLprefix'] = array('http://', 'ftp://'); 

In the third example you can see that array of prefixes or postfixes are supported. First member of array is added to URL value only if none from the elements was matched. This is especially useful in having intelligent URL links with added ability to enter addresses like "www.platon.sk" without preceding "http://".


Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy