I am planning to setup simple blog using wondercms and wondering how to get list of pages/posts from database.js.
My blog will have two unique pages,
1) List of posts (title, short description)
2) page where full text of a single post will be displayed.
[SOLVED] How to get list of pages from database.js
- turboblack
- Posts: 201
- Joined: Fri Sep 19, 2014 1:53 pm
Re: How to get list of pages from database.js
http://turboblack.ru/ example
http://old.net.eu.org/ Get ready to hamsterization! code takes less than a kilobyte! shock!
https://github.com/turboblack/HamsterCMS new version for PHP 8 with new templates
https://github.com/turboblack/HamsterCMS new version for PHP 8 with new templates
Re: How to get list of pages from database.js
Hi mike,
you are searching for something like this:
You have to put it in your theme.php.
Regards
Pascal
you are searching for something like this:
Code: Select all
<?php if (wCMS::$currentPage == 'home'): ?> <!-- On which page it will be displayed -->
<div class="container marginTop20">
<?php foreach ( wCMS::db()->pages as $pageName => $page ): ?> <!-- loop though all pages -->
<div class="col-xs-12 col-md-4">
<div><a href="<?=$pageName?>"><?=$page->title; ?></a></div>
<div><?=$page->description; ?></div>
<a href="<?=$pageName?>">more...</a>
</div>
<?php endforeach; ?>
</div>
<?php endif ?>
Regards
Pascal