typo3

How to use the Fluid Standalone view to render template based emails

$this->view->setTemplatePathAndFilename(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('donate') . 'Resources/Private/Templates/Donors/List_backend.html');

This feature is part of Extbase 1.3, included in TYPO3 4.5 LTS.

Find the Code for TYPO3 version >= 6.0 below

Add the following function to your controller (or preferably to a common abstract base controller).
(continue reading…)


Clear cache in typo3

TYPO3 6.x

first initialize the Service in your Class

/**
 * @var \TYPO3\CMS\Extbase\Service\CacheService
 */
protected $cacheService;

/**
 * @param \TYPO3\CMS\Extbase\Service\CacheService $cacheService
 * @return void
 */
public function injectCacheService(\TYPO3\CMS\Extbase\Service\CacheService $cacheService) {
    $this->cacheService = $cacheService;
}

in your function just call

$this->cacheService->clearPageCache($pids);

while $pids is an integer (for single page) or array of integers (multiple pages)

see: http://typo3.org/api/typo3cms/class_t_y_p_o3_1_1_c_m_s_1_1_extbase_1_1_service_1_1_cache_service.html

In TYPO3 since 4.5 (I think) its a static method so you have just to call

Tx_Extbase_Utility_Cache::clearPageCache($pids);

in your controller.

Found it here: http://www.phpkode.com/source/p/typo-cms/typo3_src+dummy-4.6.5/typo3/sysext/extbase/Classes/MVC/Controller/ActionController.php


TS查表

ts_bcn.20 = CONTENT
ts_bcn.20{
    table = tx_extpackage_data
    select.pidInList = 0
    select.uidInList.data = GP:uid
    renderObj = COA_INT
    renderObj {
       10 = TEXT
       10.field = package_id
       20 = TEXT
       20.field = consignee_lastname
       20.wrap = , |
       30 = TEXT
       30.field = consignee_firstname
    }
    wrap = 

|

}
lib.randomArticles = CONTENT
lib.randomArticles {
	wrap = 
|
table = tx_articledatabase_articles select { pidInList = 97 orderBy = rand() max = 3 } renderObj > renderObj = COA_INT renderObj { 10 = TEXT 10.field = title 10.wrap =

|

20 = TEXT 20.field = description 20.wrap=

|

20.typolink.parameter = 97 20.typolink.additionalParams.field=uid 20.typolink.additionalParams.wrap = &tx_articledatabase_pi1[showUid]=| 20.crop = 150|...|1 } }
10 = CONTENT
10 {
    table = pages
    select.pidInList = 5
    renderObj = COA
    renderObj {
        10 = TEXT
        10.field = title
        20 = TEXT
        20.data = COBJ:parentRecordNumber
    }
}

typo3 imagemagick pdf pages

//test
        $picConf = array();
        $picConf['image.']['file'] = t3lib_extMgm::extPath($this->extKey).'pi1/test1.pdf';
        if(!is_file($picConf['image.']['file'])){
            $picConf['image.']['file'] = "";
        }
        $theImgCode = '';
        if(is_file($picConf['image.']['file'])){
            $picConf['image.']['file.']['maxW'] = $this->conf['maxW'] ? $this->conf['maxW'] : 300;
            $picConf['image.']['file.']['maxH'] = $this->conf['maxH'] ? $this->conf['maxH'] : 600;
            $picConf['image.']['file.']['frame'] = 1;
            $picConf['image.']['altText'] = '';
            $picConf['image.']['titleText'] = '';
            $content .= $this->cObj->IMAGE($picConf['image.']);
        }

        //S1
        $document = new Imagick($picConf['image.']['file']);
        echo $document->getNumberImages();
        //S2
        $img_info = exec(t3lib_div::imageMagickCommand('identify', $cur_path));
        //echo .*\.pdf[3]

Or global: $GLOBALS[‘TYPO3_CONF_VARS’][‘GFX’][‘im_noFramePrepended’]

1 Comment more...

DAM Replace 时间字段值变更

DAM replace的时候自动加减了UTC时间. 配置禁止即可.
dam/lib/class.tx_dam_db.php


link 忽略access

config.typolinkLinkAccessRestrictedPages = NONE

mail with image CID

Global:

$mail = t3lib_div::makeInstance('t3lib_mail_Message');
            $mail->setFrom(array($sender => $sender_name));
            $mail->setReplyTo($reply_to);
            $mail->setTo($row['email']);
            $mail->setSubject($subject);

            $body = 'Any html code!';

            preg_match_all("/\embed(Swift_Image::fromPath($src));
                    if($cid){
                        $body = str_replace($src, $cid, $body);
                    }
                }
            }
            $mail->setBody($body, 'text/html', 'utf-8');
            $mail->send();

typo3<4.7 [4.7+己废弃]

require_once(PATH_t3lib.’class.t3lib_htmlmail.php’);

// Prepare mailer and send the mail
$mailer = t3lib_div::makeInstance(‘t3lib_htmlmail’);
$mailer->start();
$mailer->useBase64();
$mailer->from_email = ”;
$mailer->from_name = ”;
$mailer->charset = ‘iso-8859-1′;
//$mailer->replyto_email = $this->reply_email;
//$mailer->replyto_name = ‘TEST-TASK’;
$mailer->subject = ”;
//$mailer->addPlain($mailBody);
$mailer->addHTML($url); //支持图片CID
$mailer->setRecipient(recipient@email.com);
$mailer->setHeaders();
$mailer->setContent();
$mailer->sendtheMail();

remove image width tag

tt_content.image.20.stdWrap.parseFunc.nonTypoTagStdWrap.HTMLparser.tags.img.fixAttrib{
    width.unset = 1
    height.unset = 1
}
tt_content.textpic.20.stdWrap.parseFunc.nonTypoTagStdWrap.HTMLparser.tags.img.fixAttrib{
    width.unset = 1
    height.unset = 1
}
lib.parseFunc_RTE.nonTypoTagStdWrap.HTMLparser.tags.img.fixAttrib{
    width.unset = 1
    height.unset = 1
}



Realurl前辍

'preVars' => array(
        array(
            'GETvar' => 'no_cache',
            'valueMap' => array(
                    'nc' => 1
                ),
            'noMatch' => 'bypass'
        ),
        array(
            'GETvar' => 'abc',
            'valueMap' => array(
                'a' => 1,
                'b' => 2,
                'c' => 3,
                'd' => 4,
            ),
            'noMatch' => 'bypass'
        ),
        array(
			'GETvar' => 'L',
			'valueMap' => array(
				'de' => '0',
				'at' => '1',
				'ch' => '2'
			),
			'noMatch' => 'bypass',
		)
	)

(continue reading…)


Copyright © 1996-2010 Add Lives. All rights reserved.
iDream theme by Templates Next | Powered by WordPress