Skip to content

project79/Advanced-Find

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Advanced Find plugin

This plugin enables you to sort/merge multiple pages trees in Wolf CMS.

Article considering setup and usage of this plugin can be found at Project 79

Installation

  1. download adv-find plugin and unpack it in “wolf/plugins/” folder
  2. go to administration→plugins and enable Advanced Find plugin

Usage

Example of your backend Pages:

Home Page
|- Category 1
| |- Article 1
| |- Article 2
| |- Article 3
|- Category 2
|- Article 4
|- Article 5

Followed by this line of code to sort them out.

<?php $articles = adv_find(array('/category-1/','/category-2/','/MORE CATEGORIES/'),array('order'=>'published_on DESC', 'limit'=>5)); ?>
<?php foreach ($articles as $article): ?>
<div id="article">
    <!-- OUR TITLE -->
        <h1><?php echo $article->link(); ?></h1>
    <!-- DAVIDS SINGLE PAGE TEASER -->
<?php if (($more_pos = strpos($article->content(), '<!--more-->')) === false ) {
        // "more" trigger NOT found, so just echo content
        echo $article->content();
} else {
        // "more" trigger IS found, so echo only teaser and add link to whole article
        echo substr($article->content(), 0, $more_pos);
        echo '</p><p class="readmore">'. $article->link('Read more . . .') .'</p>';
} ?>
</div>
<?php endforeach; ?>

NOTE: The limit of children cannot be less then 2!

About

Allows you to search and sort many different archives/articles in Wolf CMS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages