This tutorial is different from the previous tutorial, on the “Add a new page source“. In the previous tutorial we add the source file, for example “home-company.php” and displays on the frontend. While at this time is the addition of tutorial page directly through the admin dashboard.
On the backend admin dashboard or completed menu “page, all pages, and add new”.
While at the source we have pages.php and header.php file:
pages.php to call the pages we have created.
header.php to display the page through menu functions available.
The question is, what if you want to display the page you created or existing pages to show, for example at home or on a contact page?
Here is a tutorial for the above, for example if you want to display the home.php page:
A place where you want to display the page paste the following code:
<? Php
$ About = $ this-> pocore () -> call-> podb-> from ( 'pages')
-> Select (array ( 'pages_description.title', 'pages_description.content'))
-> LeftJoin ( 'pages_description ON pages_description.id_pages = pages.id_pages')
-> Where ( 'pages.id_pages', '1')
-> Where ( 'pages_description.id_language', WEB_LANG_ID)
-> Where ( 'pages.active', 'Y')
-> Limit (1)
-> Fetch ();
?>
Note the script code above:
-> Where ( 'pages.id_pages', '1')
<? = $ This-> e ($ about [ 'title']);?>
<? = Htmlspecialchars_decode (_entity_decode ($ this-> e ($ about [ 'content'])));?>
So overall be as follows:
<?php
$about = $this->pocore()->call->podb->from('pages')
->select(array('pages_description.title', 'pages_description.content'))
->leftJoin('pages_description ON pages_description.id_pages = pages.id_pages')
->where('pages.id_pages', '1')
->where('pages_description.id_language', WEB_LANG_ID)
->where('pages.active', 'Y')
->limit(1)
->fetch();
?>
<div class="col-md-5 span1_of_1">
<img class="img-responsive" src="<?=BASE_URL;?>/<?=DIR_CON;?>/uploads/medium/medium_<?=$this->e($about['picture']);?>" style="width:95%;">
</div>
<div class="col-md-7 span1_of_1">
<h3><?=$this->e($about['title']);?></h3>
<p><?=specialchars_decode(_entity_decode($this->e($about['content'])));?></p>
</div>
Please adjust the div and class on the theme that is being created.
