GithubHelp home page GithubHelp logo

raylouis / advanced-find Goto Github PK

View Code? Open in Web Editor NEW

This project forked from project79/advanced-find

0.0 0.0 0.0 92 KB

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

Home Page: http://project79.net/articles/making-categories-with-advanced-find-plugin

PHP 100.00%

advanced-find's Introduction

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.