瀏覽代碼

add VH and social bars

Olivier Massot 4 年之前
父節點
當前提交
38dd3c659c

+ 36 - 0
ot_templating/Classes/ViewHelpers/Request/GetPageViewHelper.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace Opentalent\OtTemplating\ViewHelpers\Request;
+
+use Closure;
+use Opentalent\OtCore\ViewHelpers\OtAbstractViewHelper;
+use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
+
+/**
+ *   Returns the current Typo3 page (FE only)
+ *
+ *     {namespace ot=Opentalent\OtTemplating\ViewHelpers}
+ *
+ *     {ot:request.getPage()}
+ *
+ * @package Opentalent\OtTemplating\ViewHelpers
+ */
+class GetPageViewHelper extends OtAbstractViewHelper {
+
+    /**
+     * -- This method is expected by Fluid --
+     * Renders the content as html
+     *
+     * @param array $arguments
+     * @param Closure $renderChildrenClosure
+     * @param RenderingContextInterface $renderingContext
+     * @return string|null
+     */
+    public static function renderStatic(
+        array $arguments,
+        Closure $renderChildrenClosure,
+        RenderingContextInterface $renderingContext
+    ) {
+        return $GLOBALS['TSFE']->getAttribute('page');
+    }
+}

+ 36 - 0
ot_templating/Classes/ViewHelpers/Request/GetWebsiteViewHelper.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace Opentalent\OtTemplating\ViewHelpers\Request;
+
+use Closure;
+use Opentalent\OtCore\ViewHelpers\OtAbstractViewHelper;
+use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
+
+/**
+ *   Returns the current Typo3 OtWebsite (FE only)
+ *
+ *     {namespace ot=Opentalent\OtTemplating\ViewHelpers}
+ *
+ *     {ot:request.getWebsite()}
+ *
+ * @package Opentalent\OtTemplating\ViewHelpers
+ */
+class GetWebsiteViewHelper extends OtAbstractViewHelper {
+
+    /**
+     * -- This method is expected by Fluid --
+     * Renders the content as html
+     *
+     * @param array $arguments
+     * @param Closure $renderChildrenClosure
+     * @param RenderingContextInterface $renderingContext
+     * @return string|null
+     */
+    public static function renderStatic(
+        array $arguments,
+        Closure $renderChildrenClosure,
+        RenderingContextInterface $renderingContext
+    ) {
+        return $GLOBALS['TSFE']->getAttribute('ot_website');
+    }
+}

+ 48 - 0
ot_templating/Classes/ViewHelpers/Social/FacebookShareUri.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace Opentalent\OtTemplating\ViewHelpers\Social;
+
+use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
+
+/**
+ * Returns the uri for a link that will share this page on Facebook
+ *
+ *     {namespace ot=Opentalent\OtTemplating\ViewHelpers}
+ *
+ *     {ot:social.facebookShareUri()}
+ *
+ * @package Opentalent\OtTemplating\ViewHelpers
+ */
+class FacebookShareUri
+{
+
+    /**
+     * -- This method is expected by Fluid --
+     * Declares the viewhelper's parameters
+     */
+    public function initializeArguments()
+    {
+    }
+
+    /**
+     * -- This method is expected by Fluid --
+     * Renders the content as html
+     *
+     * @param array $arguments
+     * @param Closure $renderChildrenClosure
+     * @param RenderingContextInterface $renderingContext
+     * @return int|null
+     */
+    public static function renderStatic(
+        array $arguments,
+        Closure $renderChildrenClosure,
+        RenderingContextInterface $renderingContext
+    ) {
+        $page = $GLOBALS['TSFE']->getAttribute('page');
+
+
+        return "http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.la-francaise.com%2Ffr%2Fnous-connaitre%2Fles-actualites%2Fdetail%2Fconfirmation-du-biais-dovish-de-la-fed-des-taux-plus-eleves-pas-d-inquietude%2F&t=Confirmation%20du%20biais%20dovish%20de%20la%20FED%20%3A%20des%20taux%20plus%20%C3%A9lev%C3%A9s%20%3F%20Pas%20d%27inqui%C3%A9tude%20!%20-%20Groupe%20La%20Fran%C3%A7aise";
+    }
+
+
+}

+ 0 - 3
ot_templating/Resources/Private/Partials/Classic/Header.html

@@ -6,9 +6,6 @@
 <f:comment><!-- Render the assets' includes --></f:comment>
 <f:render partial="Classic/Assets" />
 
-<f:comment><!-- Render the matomo integration code --></f:comment>
-<f:comment><!--<f:render partial="Classic/Matomo" />--></f:comment>
-
 <header>
     <f:comment><!-- Render the topbar defined in partial/Topbar.html--></f:comment>
     <f:render partial="Classic/Topbar" arguments="{_all}" />

+ 0 - 37
ot_templating/Resources/Private/Partials/Classic/SocialBar.html

@@ -1,37 +0,0 @@
-{namespace ot=Opentalent\OtTemplating\ViewHelpers}
-
-
-
-<f:comment><!-- Affichage des réseaux sociaux si des urls sont définies --></f:comment>
-
-<div class="social-bar">
-  <f:if condition="{settings.structureFacebook} != ''">
-    <f:then>
-      <div class="social-logo">
-        <a href="{ot:utilities.absoluteUrl(url: settings.structureFacebook)}" target="_blank">
-          <i class="fab fa-facebook" style="color: #129af6"></i>
-        </a>
-      </div>
-    </f:then>
-  </f:if>
-
-  <f:if condition="{settings.structureTwitter} != ''">
-    <f:then>
-      <div class="social-logo">
-        <a href="{ot:utilities.absoluteUrl(url: settings.structureTwitter)}" target="_blank">
-          <i class="fab fa-twitter" style="color: #1da1f2"></i>
-        </a>
-      </div>
-    </f:then>
-  </f:if>
-
-  <f:if condition="{settings.structureInstagram} != ''">
-    <f:then>
-      <div class="social-logo">
-        <a href="{ot:utilities.absoluteUrl(url: settings.structureInstagram)}" target="_blank">
-          <i class="fab fa-instagram-square" style="color: #515BD4"></i>
-        </a>
-      </div>
-    </f:then>
-  </f:if>
-</div>

+ 0 - 2
ot_templating/Resources/Private/Partials/Classic/Topbar.html

@@ -15,8 +15,6 @@
 
     <v:render.uncache partial="Classic/UserToolbar" arguments="{_all}" />
 
-    <f:render partial="Classic/SocialBar" arguments="{_all}" />
-
     <f:comment><!-- Si un networkLogo est définit, affiche le logo du réseau --></f:comment>
     <f:if condition="{settings.networkLogo} != ''">
         <f:then>

+ 0 - 1
ot_templating/Resources/Private/Partials/Modern/Header.html

@@ -1,6 +1,5 @@
 {namespace ot=Opentalent\OtTemplating\ViewHelpers}
 
-<f:comment><!-- Render the topbar defined in partial/Topbar.html--></f:comment>
 <f:render partial="Modern/Assets" arguments="{_all}" />
 
 <f:comment><!--<f:render partial="Modern/Preloader" />--></f:comment>

+ 0 - 14
ot_templating/Resources/Public/assets/Classic/style/module/_social-bar.scss

@@ -1,14 +0,0 @@
-
-
-.social-bar {
-  @include flex;
-  flex-direction: row;
-  margin: 0 18px;
-}
-
-.social-logo {
-  height: 24px;
-  width: 24px;
-  font-size: 24px;
-  margin: 0 6px;
-}