2014-12-17 2 views
0

Typo3 Neos에서 웹 사이트 템플릿을 만들었습니다. 그러나 템플릿에서 CSS 파일을 자바 스크립트 파일 앞에 포함해야하기 때문에 자바 스크립트의 순서를 정의해야합니다.Typo3 Neos 템플릿 주문하기

Default.html 있어야 :

{namespace neos=TYPO3\Neos\ViewHelpers} 
 
{namespace ts=TYPO3\TypoScript\ViewHelpers} 
 
<!DOCTYPE html> 
 
<html lang="en"> 
 
<head> 
 
    <f:section name="meta"> 
 
      <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
 

 
     <meta name="description" content=""> 
 
     <meta name="author" content=""> 
 
    </f:section> 
 

 
    <f:section name="stylesheets"> 
 
     <!-- Bootstrap CSS --> 
 
     <link href="{f:uri.resource(path: 'css/bootstrap.css', package: 'MyApp')}" rel="stylesheet"> 
 
     <link href="{f:uri.resource(path: 'css/responsive.css', package: 'MyApp')}" rel="stylesheet"> 
 

 
     <!-- Plugins --> 
 
     <link href="{f:uri.resource(path: 'plugins/flexslider/flexslider.css', package: 'MyApp')}" rel="stylesheet"> 
 

 
     <!-- Theme style --> 
 
     <link href="{f:uri.resource(path: 'css/theme-style.css', package: 'MyApp')}" rel="stylesheet"> 
 
    </f:section> 
 

 
    <f:section name="headScripts"> 
 
     <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> 
 
     <!--[if lt IE 9]> 
 
     <script src="{f:uri.resource(path: 'js/html5.js', package: 'MyApp')}"></script> 
 
     <![endif]--> 
 

 
     <!--Retina.js plugin - @see: http://retinajs.com/--> 
 
     <script src="{f:uri.resource(path: 'plugins/retina/retina.js', package: 'MyApp')}"></script> 
 
    </f:section> 
 
</head>

그리고 Root.ts2 :

page = Page { 
head { 

    meta = TYPO3.TypoScript:Template { 
     templatePath = 'resource://MyApp/Private/Templates/Page/Default.html' 
     sectionName = 'meta' 
     title = ${q(node).property('title')} 
    } 

    stylesheets.site = TYPO3.TypoScript:Template { 
     templatePath = 'resource://MyApp/Private/Templates/Page/Default.html' 
     sectionName = 'stylesheets' 
    } 

    javascripts.site = TYPO3.TypoScript:Template { 
     templatePath = 'resource://MyApp/Private/Templates/Page/Default.html' 
     sectionName = 'headScripts' 
    } 
} 

body { 
    templatePath = 'resource://MyApp/Private/Templates/Page/Default.html' 
    sectionName = 'body' 
    parts { 
     menu = Menu 
     breadcrumb = Breadcrumb 
    } 
    // These are your content areas, you can define as many as you want, just name them and the nodePath. 
    content { 
     // The default content section 
     main = PrimaryContent { 
      nodePath = 'main' 
     } 
    } 

    javascripts.site = TYPO3.TypoScript:Template { 
     templatePath = 'resource://MyApp/Private/Templates/Page/Default.html' 
     sectionName = 'bodyScripts' 
    } 
} 
} 

되는 HTML의 결과는 : 지금이 파일을

<!DOCTYPE html><html><!-- 
 
\t This website is powered by TYPO3 Neos, the next generation CMS, a free Open 
 
\t Source Enterprise Content Management System licensed under the GNU/GPL. 
 

 
\t TYPO3 Neos is based on Flow, a powerful PHP application framework licensed under the GNU/LGPL. 
 

 
\t More information and contribution opportunities at http://neos.typo3.org and http://flow.typo3.org 
 
--><head> 
 
     <meta charset="UTF-8" /> 
 
     <title>Home</title> 
 
    
 
     <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> 
 
     <!--[if lt IE 9]> 
 
     <script src="http://app.local/_Resources/Static/Packages/MyApp/js/html5.js"></script> 
 
     <![endif]--> 
 

 
     <!--Retina.js plugin - @see: http://retinajs.com/--> 
 
     <script src="http://app.local/_Resources/Static/Packages/MyApp/plugins/retina/retina.js"></script> 
 

 
     <!-- Bootstrap CSS --> 
 
     <link href="http://app.local/_Resources/Static/Packages/MyApp/css/bootstrap.css" rel="stylesheet"> 
 
     <link href="http://app.local/_Resources/Static/Packages/MyApp/css/responsive.css" rel="stylesheet"> 
 

 
     <!-- Plugins --> 
 
     <link href="http://app.local/_Resources/Static/Packages/MyApp/plugins/flexslider/flexslider.css" rel="stylesheet"> 
 

 
     <!-- Theme style --> 
 
     <link href="http://app.local/_Resources/Static/Packages/MyApp/css/theme-style.css" rel="stylesheet"> 
 

 
    
 

 
     <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
 

 
     <meta name="description" content=""> 
 
     <meta name="author" content=""> 
 
    
 

 
    </head><body>

그러나 나는 상단에있는 메타 정보, 다음 스타일 시트 그리고 마지막으로 자바 스크립트 파일을 포함 할을합니다. 렌더링되는 요소의 순서를 정의 할 수 있습니까? 나는 Default.html의 주문이 사용 되리라 기대하지만 그렇지 않은 것으로 보인다.

답변

1

typo 스크립트에는 @ 위치가 있으므로 주문을 변경하는 데 사용할 수 있습니다. 실제로 보시려면 TYPO3.Neos/Resources/Private/TypoScript/Prototypes/Page.ts2을 확인하십시오.

[email protected] = 'start 5' 
[email protected] = 'start 10' 
[email protected] = 'start 15' 

을하거나 정의에 직접 넣을 수 있습니다 : 귀하의 경우에는 그것을 작동합니다

meta = TYPO3.TypoScript:Template { 
    @position = 'start 5' 

또한 'after headTag' 또는 'before stylesheets' 같은 STH를 사용할 수 있습니다.

TypoScript - TypoScript 2 Pocket Reference에 대해 확인해 볼 가치가 있습니다.

관련 문제