瀏覽代碼

implements news template

Olivier Massot 5 年之前
父節點
當前提交
6dcbb3b49b

+ 4 - 0
ot_templating/Configuration/TypoScript/constants.txt

@@ -56,6 +56,10 @@ plugin.tx_ottemplating {
             # Tout afficher en statique plutôt que de faire defiler
             static = 1
         }
+        news {
+            limit = 5
+            uid =
+        }
 
     }
 }

+ 43 - 0
ot_templating/Configuration/TypoScript/setup.txt

@@ -114,6 +114,7 @@ plugin.tx_ottemplating {
         staticDonors = {$plugin.tx_ottemplating.settings.donors.static}
         eventsLimit = {$plugin.tx_ottemplating.settings.events.limit}
         eventsPeriod = {$plugin.tx_ottemplating.settings.events.period}
+
     }
 }
 
@@ -149,6 +150,8 @@ plugin.tx_form {
     }
 }
 
+# Create the form object to render with:
+#     <f:cObject typoscriptObjectPath="lib.tx_ottemplating.widgets.contact"/>
 lib.tx_ottemplating.widgets.contact = USER_INT
 lib.tx_ottemplating.widgets.contact {
     userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
@@ -162,3 +165,43 @@ lib.tx_ottemplating.widgets.contact {
     }
     settings.persistenceIdentifier = EXT:ot_templating/Resources/Private/Forms/Contact.form.yaml
 }
+
+
+# * News extension integration
+
+# Disable error handling to allow displaying both list ans detail on the same page
+plugin.tx_news.settings {
+    detail.errorHandling =
+}
+
+# Create the news list and news details objects to render with:
+#     <f:cObject typoscriptObjectPath="lib.tx_ottemplating.widgets.listnews"/>
+#     <f:cObject typoscriptObjectPath="lib.tx_ottemplating.widgets.detailnews"/>
+lib.tx_ottemplating.widgets {
+    listnews = USER
+    listnews {
+        userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
+        extensionName = News
+        pluginName = Pi1
+        vendorName = GeorgRinger
+        action = list
+        switchableControllerActions {
+            News {
+                1 = list
+            }
+        }
+
+        settings < plugin.tx_news.settings
+        settings {
+            limit = {$settings.news.limit}
+            detailPid = {$settings.news.uid}
+            startingpoint = {$settings.news.uid}
+        }
+    }
+
+    detailnews < lib.tx_ottemplating.widgets.listnews
+    detailnews {
+        action = detail
+        switchableControllerActions.News.1 = detail
+    }
+}

+ 17 - 0
ot_templating/Resources/Private/Layouts/Classic/News.html

@@ -0,0 +1,17 @@
+<f:comment><!-- Special layout for the Members page --></f:comment>
+<f:layout name="News" />
+
+<f:comment><!-- Render the header defined in partial/header.html--></f:comment>
+<f:render partial="Classic/Header" arguments="{_all}" />
+
+<div class="main">
+    <f:comment><!-- Central column --></f:comment>
+    <div class="content">
+        <div class="news-section">
+
+            <f:cObject typoscriptObjectPath="lib.tx_ottemplating.widgets.detailnews" />
+            <f:cObject typoscriptObjectPath="lib.tx_ottemplating.widgets.listnews" />
+
+        </div>
+    </div>
+</div>

+ 25 - 0
ot_templating/Resources/Private/Layouts/Modern/News.html

@@ -0,0 +1,25 @@
+<f:comment><!-- Special layout for the Members page --></f:comment>
+<f:layout name="News" />
+
+<section class="t-container st-effect-3">
+    <div class="wrapper">
+
+        <f:comment><!-- Render the header defined in partial/header.html--></f:comment>
+        <f:render partial="Modern/Header" arguments="{_all}" />
+
+
+        <section class="page-section-ptb">
+            <div class="container">
+                <div class="row">
+                    <div class="col-sm-12 mt-30">
+
+                        <f:cObject typoscriptObjectPath="lib.tx_ottemplating.widgets.detailnews" />
+
+                        <f:cObject typoscriptObjectPath="lib.tx_ottemplating.widgets.listnews" />
+
+                    </div>
+                </div>
+            </div>
+        </section>
+    </div>
+</section>

+ 2 - 2
ot_templating/Resources/Private/Templates/Page/News.html

@@ -3,10 +3,10 @@
 {namespace ot=Opentalent\OtTemplating\ViewHelpers}
 
 <f:comment><!-- uses the layout 1Col, defined in layouts/[templateName]/1Col.html --></f:comment>
-<f:layout name="{ot:template.current()}/1Col" />
+<f:layout name="{ot:template.current()}/News" />
 
 <f:section name='Configuration'>
-    <flux:form id="1col" label="Gabarit simple" extensionName="Opentalent.OtTemplating">
+    <flux:form id="news" label="Gabarit Actualités" extensionName="Opentalent.OtTemplating">
     </flux:form>
 
     <f:comment><!-- Backend layout grid --></f:comment>