Page 2 of 2

Re: Bludit v1.6 BETA

Posted: Sat May 13, 2017 10:10 pm
by kaaleth
Hope it will be good decision.

Re: Bludit v1.6 BETA

Posted: Mon May 15, 2017 11:03 am
by Fred
@Diego,
How to call a page now on a template?
Before i use this tip:

Code: Select all

<?php
	$Intro = buildPage('myslugpage');
	echo '<h5>' .$Intro->title(). '</h5>';
	echo $Intro->contentRaw(true);			   	
?>
but with last version, don't work :(

Re: Bludit v1.6 BETA

Posted: Tue May 16, 2017 12:44 am
by diego
Hi,
what about this option ?

Code: Select all

$page = $pages['myslugpage'];
echo $page->title();
echo $page->contentRaw(true);
anyway, I don't see any problem with your code, the function buildPage returns an object, https://github.com/dignajar/bludit/blob ... ctions.php
Fred wrote:@Diego,
How to call a page now on a template?
Before i use this tip:

Code: Select all

<?php
	$Intro = buildPage('myslugpage');
	echo '<h5>' .$Intro->title(). '</h5>';
	echo $Intro->contentRaw(true);			   	
?>
but with last version, don't work :(

Re: Bludit v1.6 BETA

Posted: Wed May 17, 2017 12:28 am
by Fred
Hi,
I get this error:

Code: Select all

Notice: Undefined index: intro in /Applications/MAMP/htdocs/BLUDIT/bludit-master/bl-themes/Kards/php/home.php on line 14

Fatal error: Uncaught Error: Call to a member function title() on null in /Applications/MAMP/htdocs/BLUDIT/bludit-master/bl-themes/Kards/php/home.php:15 Stack trace: #0 /Applications/MAMP/htdocs/BLUDIT/bludit-master/bl-themes/Kards/index.php(47): include() #1 /Applications/MAMP/htdocs/BLUDIT/bludit-master/bl-kernel/boot/site.php(26): include('/Applications/M...') #2 /Applications/MAMP/htdocs/BLUDIT/bludit-master/index.php(39): require('/Applications/M...') #3 {main} thrown in /Applications/MAMP/htdocs/BLUDIT/bludit-master/bl-themes/Kards/php/home.php on line 15
My home.php:

Code: Select all

	<!-- intro section
   ================================================== -->
   <section id="intro">   

   	<div class="intro-overlay"></div>	

   	<div class="intro-content">
   		<div class="row">

   			<div class="col-twelve">
			 	<!-- Intro
			   ================================================== -->
			   	<?php
					$Intro = $pages['intro'];
					echo '<h5>' .$Intro->title(). '</h5>';
					echo $Intro->contentRaw(true);			   	
				?>  
	   		</div>  
   			
   		</div>   		 		
   	</div> <!-- /intro-content --> 

   	<ul class="intro-social">        
         <li><a href="<?php echo $Site->facebook() ?>"><i class="fa fa-facebook"></i></a></li>
         <li><a href="<?php echo $Site->twitter() ?>"><i class="fa fa-twitter"></i></a></li>
         <li><a href="<?php echo $Site->instagram() ?>"><i class="fa fa-instagram"></i></a></li>
         <li><a href="http://fr.pinterest.com/kaplonfrederic/p%C3%A2tisserie/"><i class="fa fa-pinterest"></i></a></li>
      </ul> <!-- /intro-social -->      	

   </section> <!-- /intro -->


   <!-- about section
   ================================================== -->
   <section id="about">  

   	<div class="row section-intro">
   		<div class="col-twelve">

			<!-- About
			================================================== -->
			<?php
				$About = $pages['about'];
				echo '<h5>' .$About->title(). '</h5>';
				echo $About->contentRaw(true);			   	
			?>			

   		</div>   		
   	</div> <!-- /section-intro -->

   	<div class="row about-content">

   		<div class="col-twelve tab-full">

			<!-- Skills
			================================================== -->
			<?php
				$Skills = $pages['selection-rigoureuse-de-nos-matieres-premieres'];
				echo '<h3>' .$Skills->title(). '</h3>';
				echo $Skills->content(true);			   	
			?>	

   		</div>

   	</div>

   	<div class="row button-section">
   		<div class="col-twelve">
   			<a href="#contact" title="Contactez-nous" class="button stroke smoothscroll">Contactez-nous</a>
   		</div>   		
   	</div>

   </section> <!-- /process-->    


	<!-- Portfolio Section
   ================================================== -->
	<section id="portfolio">

	<div class="row section-intro">
   		<div class="col-twelve">

			<!-- Portfolio_intro
			================================================== -->
			<?php
				$Portfolio_intro =$pages['nos-realisations'];
				echo '<h5>' .$Portfolio_intro->title(). '</h5><small>(Cliquez sur l’image pour plus de détails)</small>';
				echo $Portfolio_intro->contentRaw(true);			   	
			?>	

   		</div>   		
   	</div> <!-- /section-intro--> 
   	
   <!-- Gallery
   ================================================== -->    	
   	<?php include(PATH_THEME_PHP.'gallery.php') ?>

		
	</section> <!-- /portfolio --> 

Re: Bludit v1.6 BETA

Posted: Wed May 17, 2017 10:20 am
by diego
Is ok the code, but maybe you don't have the page key `intro` ?

Try to print all pages, with this change:

Code: Select all

               <?php
               var_dump($pages);exit;
               
               $Intro = $pages['intro'];
               echo '<h5>' .$Intro->title(). '</h5>';
               echo $Intro->contentRaw(true);               
            ?>