Quote by: jmucchielloMachinari - Yours only works on staticpages
Yup. that's what he wanted. I presumed that he has a plan for checking the current page in order to ensure that the block returns empty when he's not on a staticpage.
and chrisp, if you haven't thought of that then here's where your start. Here are two options for your phpblock. both work and will only return stuff on staticpages.
Text Formatted Code
/* I want this block to return something on staticpages only. */
function phpblock_SPpagetitle() {
global $_CONF;
$retval = '';
$thisurl = COM_getCurrentURL();
if (eregi('staticpage', $thisurl)){
$retval = $_CONF['pagetitle'];
}
return $retval;
}
/* I want this block to return something on the specified staticpages only. */
function phpblock_SPpagetitle() {
global $_CONF;
$retval = '';
$thisurl = COM_getCurrentURL();
$pages = array('http://mypage1',
'http://mypage2',
'http://mypage3');
if (in_array($thisurl, $pages){
$retval = $_CONF['pagetitle'];
}
return $retval;
}