typo3

bcn导航条

方法一:

TS配置

temp.mypath=HMENU
temp.mypath.special=rootline
temp.mypath.includeNotInMenu = 1
#temp.mypath.special.range= 1 | -1
temp.mypath.wrap = <ul>|</ul>
temp.mypath.1=TMENU
temp.mypath.1{
#NO.allWrap= <li>|&raquo;</li>|*|<li>|&raquo;</li>|*|<li  class=”current”>|</li>
NO.allWrap= <li>|&gt;</li>|*|<li>|&gt;</li>|*|<li  class=”current”>|</li>
NO.doNotLinkIt=|*| |*| 1   #No Link in the last node

}
ts_navpath = COA
ts_navpath.10 < temp.mypath

 

方法二:

插件名:julle_navpath

主要代码:

function main($content,$conf)    {
$rL = $GLOBALS[“TSFE”]->tmpl->rootLine;

// Prepare vars:
$linkArr = Array();

// Traverse menuitems:
$length = sizeof($rL);
$start = 0;
$end = $length;
for($i = $start;$i< $end;$i++) {
$pages_row = $rL[$i];
$linkArr[] = ‘<li>’.$this->pi_linkToPage(
$pages_row[“nav_title”]?$pages_row[“nav_title”]:$pages_row[“title”],
$pages_row[“uid”],
$pages_row[“target”]).'</lid>’;

}
//return ‘<ul ‘.$this->pi_classParam(“menu”).’ >’.implode(” > “,$linkArr).'</ul>’;

 

#ts_navpath = USER
#ts_navpath.userFunc = tx_jullenavpath_pi1->main
return ‘<ul>’.implode(” > “,$linkArr).'</ul>’;
}

################################

$rL = $GLOBALS[“TSFE”]->tmpl->rootLine;
// Prepare vars:
$linkArr = Array();
// Traverse menuitems:
for($i = 0;$i< count($rL);$i++) {
$linkArr[] = $rL[$i][“nav_title”]?$rL[$i][“nav_title”]:$rL[$i][“title”];

}
return “/”.implode(“/”,$linkArr);




typo3页面路径

$GLOBALS["TSFE"]->tmpl->rootLine;


flexform用RTE

            <description>
                <TCEforms type="array">
                    <config type="array">
                    <type>text</type>
                    <cols>40</cols>
                    <rows>5</rows>
                    </config>
                    <label>Text</label>
                    <defaultExtras>richtext[*]:rte_transform[mode=ts_css]</defaultExtras>
                </TCEforms>
            </description>


TS连接字符串

  1=TMENU
  1{
    noBlur = 1
    #expAll = 0   #sub menu all show
    wrap = <ul>|</ul>
    NO.stdWrap.htmlSpecialChars = 1
    NO.allWrap.dataWrap= <li>|
    NO.wrapItemAndSub = |</li>
    NO.ATagParams.dataWrap =  title="{field:title}" 
   
    ACT < .NO
    ACT = 1
    #ACT.linkWrap = <li class="current" onmouseover="show(this)" onmouseout="hide(this)">|</li>
    #ACT.ATagParams = class="current" 
    ACT.ATagParams.dataWrap := appendString(‘ class="current"’)
   
  }


TS |*|与|| 用法

当我们在网站上面经常会出现:  TYPO3中文TYPO3教程  |  TYPO3技术   这样的效果,就是只需要中间有竖线分割符,那么用TYPO3 TS怎么呢?
请看下面介绍:
linkWrap = |&nbsp;&nbsp;&#124;&nbsp;&nbsp; |*| |&nbsp;&nbsp;&#124;&nbsp;&nbsp; |*| |

|*|可以把一个值分成三部分(first,middle,last),然后||可以把分出来的值再细分成几段。
比如:TS:backColor = red || yellow |*||*| blue || olive
这里面的
First:red||yellow
middle:为空
last:blue||olive
根据:If the middle-value is empty, the last part of the first-value is repeated
如果middle为空,那么要放middle的值的地方就用first值中的最后一个取代。
也就是说,在n个菜单列表中,n>4,
第1个为 red
第2个为 yellow
倒数第2个为 blue
倒数第1个为olive,
中间一律为yellow也就是first中的最后一个
就这个例子如果n=4,那么他们分别是 red,yellow,blue,olive
如果n=3,则是red,blue,olive(因为last的优先级最高)
如果n=2则是blue,olive(同上)
n=1则为blue

 

转载:

TYPO3中文网

本文地址:

http://www.51typo3.cn/typoscript/70.html


GIF 剪切空白边问题

ImageMagick  最新版本中

t3lib\class.t3lib_stdgraphic.php
line 2322行, t3lib\class.t3lib_stdgraphic.php
$params .= ‘ -crop ‘.$data[‘origW’].’x’.$data[‘origH’].’+’.$offsetX.’+’.$offsetY.’ ‘;
改成
$params .= ‘ -crop ‘.$data[‘origW’].’x’.$data[‘origH’].’+’.$offsetX.’+’.$offsetY.’! ‘;
 


TCA-select

[‘columns’][fieldname][‘config’] / TYPE: “select”

http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.2.0/view/4/2/#id4425347

fieldname

Selectors boxes are very common elements in forms. By the “select” type you can create selector boxes. In the most simple form this is a list of values among which you can chose only one. In that way it is similar to the “radio” type above. (continue reading…)


flexform-itemsProcFunc and foreign_table

                            <config>
                                <type>select</type>
                                <itemsProcFunc>user_itemsProcFuncforfile->files_insertExtraCodes</itemsProcFunc>
                                <foreign_table>tx_extdocument_list</foreign_table>

                                <foreign_table_where>and tx_extdocument_list.deleted=0 and tx_extdocument_list.hidden=0</foreign_table_where>                               
                                <maxitems>1000</maxitems>
                                <size>10</size>
                                <multiple>0</multiple>
                                <selectedListStyle>width:300px</selectedListStyle>
                                <itemListStyle>width:300px</itemListStyle>
                            </config>

 

 <?php
 /**
  * ‘itemsProcFunc’ for the ‘document’ extension.
  * @package TYPO3
  * @subpackage shop
  */
class user_itemsProcFuncforfile {
/**
 * insert ‘codes’, found in the [‘what_to_display’] array to the selector in the BE.
 *
 * @param    array        $config: extension configuration array
 * @return    array        $config array with extra codes merged in
 */
    function files_insertExtraCodes($config) {
        $sql = "SELECT * FROM tx_extdocument_list where deleted=’0′ AND hidden=’0’";
        if ( ! ($res = $GLOBALS[‘TYPO3_DB’]->sql_query($sql)) ) { return; }
        $presets = array();
        while ($row = $GLOBALS[‘TYPO3_DB’]->sql_fetch_assoc($res))
        {
            $filetype = end(explode(".",$row[‘file_name_tmp’]));
            $presets[] = array($row[‘file_name’].’ (‘.$filetype.$this->fileSizeShow($row[‘file_size’]).’)’,$row[‘uid’]);
        }
        $config[‘items’] =  array_merge($config[‘items’], $presets);
        return $config;
    }
    
    
    /**
     * fileSizeShow KB MB
     * @param $filesize
     * @return size
     */
    function fileSizeShow($filesize=0) {
        if ($filesize<1024) {
            return ‘,’.number_format($filesize)."KB";
        }elseif ($filesize<1024*1024){
            return ‘,’.number_format($filesize/1024)."MB";
        }else{
            return ‘,’.number_format($filesize/(1024*1024))."GB";
        }
    }

}

?>


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