简体   繁体   English

typo3 css_styled内容编辑源

[英]typo3 css_styled content edit source

I have the following problem: 我有以下问题:

I am using typo3 4.7.7 and I am adding custom columns in the Backend. 我正在使用typo3 4.7.7,并且在后端中添加了自定义列。 I am able to do taht by place a configuration array in the /typo3conf/extTables.php 我可以通过将配置数组放置在/typo3conf/extTables.php中来执行此操作

$TCA["tt_content"]["columns"]["colPos"]["config"]["items"] = array (
"3" => array ("Border,"3"),
"2" => array ("Right","2"),
"1" => array ("Left","1"),
"0" => array ("Normal","0"),
"5" => array ("Central","5"),
"6" => array ("Border","6"),
"4" => array ("Footer","4")
);

Then set: 然后设置:

mod.SHARED.colPos_list=0,1,2,3,4,5,6

in the TSconfig. 在TSconfig中。

It is working, I enjoy my new columns :), but there is a problem. 它正在工作,我喜欢我的新专栏文章:),但是有一个问题。 I want to be able to use the css_styled_content to map my new columns to my html template. 我希望能够使用css_styled_content将新列映射到html模板。 This is not possible, because the "get" constants of css_styled_content are hard coded and I am not able to use something like "content.getFooter". 这是不可能的,因为css_styled_content的“ get”常量是硬编码的,并且我无法使用“ content.getFooter”之类的东西。 At the moment the only way I can get my content is like this: 目前,我获取内容的唯一方法是:

...
page.10 = CONTENT
page.10.table = tt_content
page.10.select {
  orderBy = sorting
  where = colPos = 4
}
  page.10.renderObj = COA
  page.10.renderObj {
  10 = TEXT
  10.field = header
  20 = TEXT
  20.field = bodytext
}
...

This is a lot of code, so I was wondering if there is a way to "make" CSC recognize my new columns, so that I would be able to use "content.getMYCUSTOM_COLUMN_NAME". 这是很多代码,所以我想知道是否有一种方法可以“使” CSC识别我的新列,以便能够使用“ content.getMYCUSTOM_COLUMN_NAME”。

PS I do not want to use templavoila and I found something in the source of CSC under /static/setup.txt : PS我不想使用templavoila,我在/static/setup.txt的CSC源码中找到了一些东西:

# Clear out any constants in this reserved room!
styles.content >

# get content
styles.content.get = CONTENT
styles.content.get {
    table = tt_content
    select.orderBy = sorting
    select.where = colPos=0
    select.languageField = sys_language_uid
}

# get content, left
styles.content.getLeft < styles.content.get
styles.content.getLeft.select.where = colPos=1

# get content, right
styles.content.getRight < styles.content.get
styles.content.getRight.select.where = colPos=2

# get content, margin
styles.content.getBorder < styles.content.get
styles.content.getBorder.select.where = colPos=3

# get news
styles.content.getNews < styles.content.get
styles.content.getNews.select.pidInList = {$styles.content.getNews.newsPid}

# Edit page object:
styles.content.editPanelPage = COA
styles.content.editPanelPage {
    10 = EDITPANEL
    10 {
        allow = toolbar,move,hide
        label.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.page
        label.wrap = |&nbsp;<b>%s</b>
    }
}

I then tried to add: 然后,我尝试添加:

# get content, footer
styles.content.getFooter < styles.content.get
styles.content.getFooter.select.where = colPos=4

But it did not work. 但这没有用。

you are on the right track. 您走在正确的轨道上。 try to create your own Content Object: 尝试创建自己的内容对象:

temp.footer < styles.content.get
temp.footer.select.where = colPos=4

page = PAGE
page.100 < temp.footer

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM