Ver código fonte

add info footer

Kevin 4 anos atrás
pai
commit
192ecc579e

+ 0 - 21
web/app/themes/la_mine/footer.php

@@ -1,21 +0,0 @@
-<?php
-/**
- * Third party plugins that hijack the theme will call wp_footer() to get the footer template.
- * We use this to end our output buffer (started in header.php) and render into the view/page-plugin.twig template.
- *
- * If you're not using a plugin that requries this behavior (ones that do include Events Calendar Pro and
- * WooCommerce) you can delete this file and header.php
- *
- * @package  WordPress
- * @subpackage  Timber
- * @since   Timber 0.1
- */
-
-$timberContext = $GLOBALS['timberContext']; // @codingStandardsIgnoreFile
-if ( ! isset( $timberContext ) ) {
-	throw new \Exception( 'Timber context not set in footer.' );
-}
-$timberContext['content'] = ob_get_contents();
-ob_end_clean();
-$templates = array( 'page-plugin.twig' );
-Timber::render( $templates, $timberContext );

+ 20 - 15
web/app/themes/la_mine/functions.php

@@ -22,23 +22,28 @@ if ( file_exists( $composer_autoload ) ) {
 
 if( function_exists('acf_add_options_page') ) {
 
-   acf_add_options_page(array(
-      'page_title'   => 'Information',
-      'menu_title'   => 'Information',
-      'icon_url'    => 'dashicons-buddicons-activity',
-      'capability' => 'edit_posts',
-      'redirect'     => false
-   ));
-
-  acf_add_options_page(array(
-     'page_title'   => 'Partenaires',
-     'menu_title'   => 'Partenaires',
-     'icon_url'    => 'dashicons-buddicons-activity',
-     'capability' => 'edit_posts',
-     'redirect'     => false
-  ));
+	acf_add_options_page(array(
+		'page_title' 	=> 'Information',
+		'menu_title'	=> 'Information',
+		'menu_slug' 	=> 'information',
+		'capability'	=> 'edit_posts',
+		'redirect'		=> false
+	));
+
+	acf_add_options_sub_page(array(
+		'page_title' 	=> 'Partenaires',
+		'menu_title'	=> 'Partenaires',
+		'parent_slug'	=> 'information',
+	));
+
 }
 
+add_filter( 'timber_context', 'options_footer'  );
+
+function options_footer( $context ) {
+    $context['options'] = get_fields('option');
+    return $context;
+}
 
 /**
  * This ensures that Timber is loaded and available as a PHP class.

+ 3 - 3
web/app/themes/la_mine/index.php

@@ -15,9 +15,9 @@
 
 $context          = Timber::context();
 $context['posts'] = new Timber\PostQuery();
-$context['foo']   = 'bar';
-$templates        = array( 'index.twig' );
+
+$templates        = array( 'base.twig' );
 if ( is_home() ) {
-	array_unshift( $templates, 'front-page.twig', 'home.twig' );
+	array_unshift( $templates, 'front-page.twig', 'accueil.twig' );
 }
 Timber::render( $templates, $context );

+ 2 - 1
web/app/themes/la_mine/templates/base.twig

@@ -7,6 +7,7 @@
 {% endblock %}
 
 	<body class="{{body_class}}" data-template="base.twig">
+
 		<a class="skip-link screen-reader-text" href="#content">{{ _e( 'Skip to content') }}</a>
 		<header class="header">
 			{% block header %}
@@ -35,7 +36,7 @@
 			{% endif %}
 		</section>
 
-		{% block footer %}
+		{% block footer %} 
 			<footer id="footer">
 				{% include 'footer.twig' %}
 			</footer>

+ 2 - 1
web/app/themes/la_mine/templates/footer.twig

@@ -1 +1,2 @@
-Copyright {{"now"|date('Y')}} by FiguresLibres
+{{ dump(options) }}
+<h3>{{ site_options }}</h3>

+ 1 - 3
web/app/themes/la_mine/templates/index.twig

@@ -1,11 +1,9 @@
 {% extends "base.twig" %}
 
 {% block content %}
-	<h2>{{ foo }}</h2>
-	<p>{{ qux }}</p>
 	{% for post in posts %}
 		{% include ['tease-'~post.post_type~'.twig', 'tease.twig'] %}
 	{% endfor %}
-	
+
 	{% include 'partial/pagination.twig' with { pagination: posts.pagination({show_all: false, mid_size: 3, end_size: 2}) } %}
 {% endblock %}

+ 1 - 1
web/app/themes/la_mine/templates/page-plugin.twig

@@ -4,4 +4,4 @@
   <div class="container content-wrapper">
     {{content}}
   </div><!-- /content-wrapper -->
-{% endblock %}
+{% endblock %}

+ 1 - 1
web/app/themes/la_mine/templates/page.twig

@@ -11,4 +11,4 @@
 			</section>
 		</article>
 	</div><!-- /content-wrapper -->
-{% endblock %}
+{% endblock %}

+ 2 - 2
web/app/themes/la_mine/templates/privatiser_lespace.twig

@@ -13,7 +13,7 @@
 			</div>
 
 			<div class="__body">
-			{{ post.meta('paragraphe_descriptif') }}
+				{{ post.meta('paragraphe_descriptif') }}
 			</div>
 
 		</div>
@@ -50,7 +50,7 @@
 				{% endfor %}
 			</div>
 
-			{% include 'temcomponents/buttons/boutton_privatiser.html.twigplate'%}
+			{% include 'components/buttons/boutton_privatiser.html.twig' %}
 
 		</div>