Bludit v1.6 BETA

kaaleth
Master Bludit
Posts: 117
Joined: Sun Jun 14, 2015 9:55 am

Hope it will be good decision.
User avatar
Fred
Legend Bludit
Posts: 236
Joined: Wed Jun 24, 2015 2:14 pm
Location: France
Contact:

@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 :(
╰☆╮Bludit╰☆╮ is a open source and community contributions are essential to project success!
You are looking for a light forum based Json? Try my project Flatboard, it is free. ;)
Sorry for my little english, i'm french :oops:
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

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 :(
User avatar
Fred
Legend Bludit
Posts: 236
Joined: Wed Jun 24, 2015 2:14 pm
Location: France
Contact:

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 --> 
╰☆╮Bludit╰☆╮ is a open source and community contributions are essential to project success!
You are looking for a light forum based Json? Try my project Flatboard, it is free. ;)
Sorry for my little english, i'm french :oops:
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

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);               
            ?>  
Locked