0

我希望一个页面比普通页面包含更多的 javascript。我使用了这段代码:

    page=PAGE
page{
headerData{
5=TEXT
5.value=<linkhref="fileadmin/templates/style.css"rel="stylesheet"type="text/css"/>
10=TEXT
10.value=<linkhref="http://fonts.googleapis.com/css?family=Cabin+Sketch:bold"rel="stylesheet"type="text/css"/>
20=TEXT
20.value=<scriptsrc="http://code.jquery.com/jquery-latest.js"type="text/javascript"></script>
40=TEXT
40.value=<scripttype="text/javascript"src="fileadmin/templates/js/easySlider1.7.js"></script>
50=TEXT
50.value=<scripttype="text/javascript">$(document).ready(function(){$("#slider").easySlider({auto:true,continuous:true,prevId:'prevBtn',prevText:'',nextId:'nextBtn',nextText:'',speed:1000,pause:20000,});});</script>
**[PIDinRootline = 8]**
60=TEXT
60.value=<linkhref="fileadmin/templates/skills/default.css"rel="stylesheet"type="text/css"/>
70=TEXT
70.value=<scriptsrc="fileadmin/templates/skills/raphael.js"type="text/javascript"></script>
80=TEXT
80.value=<scriptsrc="fileadmin/templates/skills/init.js"type="text/javascript"></script>
**[end]**
}

但是这三个都包含在每一页中!

谢谢

4

3 回答 3

1

条件不能嵌套在任何块中,因此:

page=PAGE
page{
  headerData{
     5=TEXT
     //...
     [PIDinRootline = 8]
       60=TEXT
     [end]
  }
}

你应该像这样使用它:

page=PAGE
page{
  headerData{
     5=TEXT
     //...
  }
}

[PIDinRootline = 8]
    page.headerData.60=TEXT
[end]

当然,我假设您的样本中的星号**[PIDinRootline = 8]**-**[end]**是偶然的 - 它们是不允许的

于 2012-11-29T20:26:06.530 回答
1

尝试这个:

[globalVar = TSFE:id =8]
  page.headerData.60 = TEXT
  page.headerData.60.value (
    <link href="fileadmin/templates/skills/default.css" rel="stylesheet" type="text/css" />
    <script src="fileadmin/templates/skills/raphael.js" type="text/javascript"></script>
    <script src="fileadmin/templates/skills/init.js" type="text/javascript"></script>
)
[global]

甚至更好:

[globalVar = TSFE:id =8]
    page.includeCSS.fonts81 = fileadmin/templates/skills/default.css
    page.includeJS {
        file81 = fileadmin/templates/skills/raphael.js
        file81.type = application/x-javascript
        file82 = fileadmin/templates/skills/init.js
        file82.type = application/x-javascript

    }
[global]
于 2012-11-29T22:44:01.690 回答
0
[PIDinRootline=8]
      page.headerData.60 = TEXT
      page.headerData.60.value = <link href="fileadmin/templates/skills/default.css" rel="stylesheet" type="text/css" />
      page.headerData.70 = TEXT
      page.headerData.70.value = <script src="fileadmin/templates/skills/raphael.js" type="text/javascript"></script>
      page.headerData.80 = TEXT
      page.headerData.80.value = <script src="fileadmin/templates/skills/init.js" type="text/javascript"></script>
[END]

谢谢

于 2012-11-29T20:47:40.940 回答