Useful helpers

edited March 2018 in General

Show breadcrubs
{!! PagesTools::setBreadcrumbs($_page) !!}
display page breadcrumbs. can be overrided in themepath/views/tools/language-switch.blade
return: view
available vars: $pages $current_url

Display list of pages related by tag
{!! PagesTools::getRelatedByTag($tags, $random = FALSE, $limit = NULL) !!}
return collection of pages related by tag to the current page
params : tags - array, random - bool, limit - int

Display search form on page
{!! \SearchTools::setSearchBox(['searchurl']) !!}
<div data-pattern-func="SearchTools@setSearchBox-searchurl"></div>
view in themepath/views/search/search-box.blade.php
params: array[0] string
return: view
available vars: $url $search_string

Display search results on page
{!! \SearchTools::setResults() !!}
<div data-pattern-func="SearchTools@setResults"></div>
view in themepath/views/search/search-results.blade.php
return: view
available vars: $results $search_string

Get images by Gallery
{!! \MediaTools::getImagesByGallery($gallery_id) !!}
params gallery_id int
return array of images objects

Get image By id
{!! \MediaTools::getImage($image_id) !!}
params image_id int
return image objects

Check if is Mobile device

@php $device = new \Atlantis\Helpers\Lib\MobileDetect; @endphp
{!! $device->isMobile() !!}
{!! $device->isTablet() !!}

Register Script
{!! \Atlantis\Helpers\Assets::registerScript('PATHT_TO.js') !!}

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!