Categories and Filtering

Category Methods and Views

Get Category Pages

{!! PageBuilder::category($options = array()) !!}

Will return and format a subpage list using the category templates.

available options:

'page_id' => 6 (default: current page)

'view' => 'sidebar' (default: default)

'type' => 'all' (can be set to 'pages' or 'categories' - default: all)

'per_page' => 10 (int - number of pages to display per page - default: 20 [0 or less than 20 pages = no pagination])

'limit' => 0 (int - total number of subpages - default: 0 [0 = no limit])

'content' => 'cat text' (string - passes value to view - default: null) 

Get Category Navigation Links

{{ Pagebuilder::category_link('next') }} or {{ Pagebuilder::category_link('prev') }}

Will return the url for the next or previous page in the same page level (next goes down the page list, prev goes up).

Get Category Pages (with filtered results)

{!! Pagebuilder::category_filter($block_name, $search, $options) !!}

Will load pages matching the search term and has the same options/variables as the main category function.

Additional options:

'match' => '=' (default: '=' - will return pages with the page block contents exactly matching the search term, other options: 'in' - will return all pages where the search term is in the block)

Get Category Pages (based on use search results)

{!! Pagebuilder::search($options) !!} 

Will load pages matching the search term and has the same options/variables as the main category function.

additional options:

'templates' => array(4,6) (default: null - only include pages with specific templates if not null)

notes

The search query value is taken from the url after the search segement, ie. /[page]/search/[query].  If the page url is search then the query is taken as /[page]/[query].

If there is no search segment in the url or if the query is empty then the querystring parameter q will be used as the query.

Template Locations

/categories/[category_view]/pages_wrap.blade.php (main template wrapper)  

/categories/[category_view]/page.blade.php (template for each subpage)

[category_view] is the template set

Available Variables

$category_id (int - page id of the category being displayed)

$total (int - total number of subpages)

Category wrap only variables:

$pages (string - returns the formatted pages)

$pagination or $links (string - returns the pagination links)

$content (string - returns the content option value / formatted search text)

$search_query (string - returns search query if used in a search)

Subpage template only variables:

$page->id (int - subpage page id)

$page->name (string - page name)

$page->full_name (string - full page name including category path)

$page->url (string - page url)

$is_first (bool - check if page is first in category)

$is_last (bool - check if page is last in category)

$count (int - gets page position in category)

Modern Framework

Based on Laravel 5.4

Constant development

Additional features always being planned/researched

Open source

"git" involved

Latest from the blog


read more


read more


read more