Friday, November 16, 2012

Multidomain with realurl

To set up a realurl config for multidomain and with different template, you can adapt this example for your realurlconf.php.

$RootPID = array(
    
'www.domain1.com' => '1',
    
'www.domain2.com' => '2',
    
'intranet.domain1.com' => '3'
);     

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
    
'_DEFAULT' => array (
        
'init' => array (
            
'enableCHashCache' => true,
            
'appendMissingSlash' => 'ifNotFile,redirect'
      ...
        'pagePath' => array (
            
'type' => 'user',
            
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
            
'spaceCharacter' => '-',
            
'languageGetVar' => 'L',
            
'expireDays' => 7,
            
'rootpage_id' => $RootPID[$_SERVER['HTTP_HOST']],
        ), 

      ...
   ),

Monday, November 12, 2012

pdf_generator2 in tt_news single view

With pdf_generator2, we can produce pdf format of our web page. To use this extension in tt_news single view, we need to setup the typoscript configuration. This typoscript example will show the pdf link beside the tt_news single view title and put the web url as header and page number and date as footer in the pdf document.

1. Put this definition in constants section of the main template:

pdf_generator2 {
  size = A4
  top = 15
  bottom = 15
  left = 15
  right = 15
  cssmedia = print
  max_execution_time = 10000
  renderfields = 1
  string_search1 = /*<![CDATA[*/
  string_replace1 = /* <![CDATA[ */
  string_search2 = /*]]>*/
  string_replace2 = /* ]]> */
  string_search2 = <body>
  string_replace2 = <body> <!-- PDF VERSION -->
}

remember that we need to use cssmedia = print to hide the pdf link in the pdf version.