Storage Page ID using the TS in TYPO3 ……..

Storage Page ID using the TS in TYPO3 ……..

// Storage Pageid in Code

$pageid = $conf[‘StoragePid’];
$res = $GLOBALS[‘TYPO3_DB’]->exec_SELECTquery(‘*’,’tablename’,”deleted=0 and hidden=0 and pid=$pageid”,”,”);

// Storage Page ID in Backend Using TS….

# 48 is the FOLDER ID where the slider is store.
plugin.tx_slider_pi1.StoragePid=48

 

Banner PHP CODE…

 

function main($content, $conf) {
$this->conf = $conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
$this->fullURL = t3lib_div::getIndpEnv(‘TYPO3_SITE_URL’);
$cObject = t3lib_div::makeInstance(‘tslib_cObj’);

$GLOBALS[‘TSFE’]->additionalHeaderData[] = ‘<script src=”fileadmin/templates/js/jquery.bxslider.js” type=”text/javascript”></script>
<script type=”text/javascript”>
$(function(){
$(“#bxslider”).bxSlider({
auto : true,
mode: “fade”,
captions: true
});
})
</script>
‘;

$path = “uploads/tx_banner/”;
$pid = $this->conf[‘bannerStorage’];
$content .=’

<div id=”bxslider”>’;
$res = $GLOBALS[‘TYPO3_DB’]->exec_SELECTquery(‘title,image,link’,’tx_banner_data’,’hidden = 0 and deleted = 0 and pid = ‘.$pid.”);
if($GLOBALS[‘TYPO3_DB’]->sql_num_rows($res) > 0){
while($row = $GLOBALS[‘TYPO3_DB’]->sql_fetch_assoc($res)){
$this->siteURL = t3lib_div::getIndpEnv(‘TYPO3_SITE_URL’);
$cObject = t3lib_div::makeInstance(‘tslib_cObj’);
$lConf[‘img’] = ‘IMAGE’;
$lConf[‘img.’][‘file’] = $path.$row[‘image’];
$lConf[‘img.’][‘file.’][‘width’]=’685′;
$lConf[‘img.’][‘file.’][‘height’]=’240′;
$lConf[‘img.’][‘file.’][‘params’]=’-quality 100′;
$images = $cObject->IMAGE($lConf[‘img.’]);

$configurations[‘returnLast’] = ‘url’;
$configurations[‘parameter’] = $row[‘link’];
$pagelink = $this->fullURL.htmlspecialchars($cObject->typolink(NULL, $configurations));

$content .=’
<div><div class=”images”>’.$images.'</div>
<div class=”bannerText”>’;
if($row[‘link’] == “”){
$content .= ‘<span class=”banner_h”>’.$row[‘title’].'</span>’;
}else{
$content .= ‘<span class=”banner_h”><a href=”‘.$pagelink.'”>’.$row[‘title’].'</a></span>’;
}

$content .='</div>
</div>
‘;
}
}

$content .='</div>’;
return $this->pi_wrapInBaseClass($content);
}

Leave a Reply