Xysti on Laravel
A feature rich content framework bundle for Laravel.
Xysti makes templating simpler. You provide a sitemap array containing page meta and Xysti's template helper generates your <title>
tags, breadcrumbs, navigation menus and more.
Xysti's sitemap makes many tasks simpler, for example to require user authentication for a page just include 'auth' => TRUE
in the page meta. Need to hide a page from the navigation menu? 'hidden' => TRUE
Xysti makes developing both static and dynamic websites a breeze a master template is automatically loaded with your page content nested.
- Flexible template helper functions
- Master template and content views
- Automated post data validation (requires Former)
- Easily generate login / logout pages
- Rich error views using your master template
Installating Xysti only takes a few steps.
First, upload all the files to the bundles directory.
Second, copy the two config files xysti.php
and sitemap.php
to your application/config
directory.
Finally, add xysti to your bundles array: application/bundles.php
.
return array(
'xysti' => array( 'auto' => true )
);
Page meta is the foundation of Xysti. The meta takes the form of a recursive array defined in config/sitemap.php
. Each page is a key within the array with at least a title
attribute.
title
string
The page title you would like to use within the navigation menu, the<title>
and<h1>
content
string
The content view to load from theviews/content
directory. Default issegment1.segment2.segment3
redirect
string
The URI will redirect to another page or another website. Default isfalse
hidden
bool
Is the hidden in the navigation menu and in thesitemap.xml
. Default isfalse
. Ifauth = true
the page will be hidden from non authenticated users.disabled
bool
Iftrue
the page will 404. Default isfalse
post_rules
array
An array of POST validator rules.post_success
string
The URI of the page to redirect to after successful POST validation./
array
An array of child pages and their meta.
return array(
'about' => array(
'title' = 'About Us'
)
);
return array(
'portfolio' => array(
'title' => 'My portfolio',
'/' => array(
'web-design' => array(
'title' => 'Website design'
),
'photography' => array(
'title' => 'Photography'
)
)
)
);
return array(
'images' => array(
'title' => 'Images',
'/' => 'dynamic'
)
);
On the outset the redirect
and href
meta attributes may appear to do the same thing but it's a matter of visibility. href
should be used to incorporate an link in a menu where a page has never existed; though it appears in the context with an apparent URI no URI exists at that place. redirect
is used if you wish to mask the destination of a URI. For instance you may wish to redirect the URI login
to users/authentication/login
. Or it could be used as a short url for an external page. For instance example.com/linkedin
could redirect to http://www.linkedin.com/your-profile
.
return array(
'contact' => array(
'title' => 'Contact us',
'post_rules' => array(
'email' => 'required|email',
'message' => 'required'
),
'post_success' => 'thank-you'
),
'thank-you' => array(
'title' => 'Thanks for getting in touch!'
)
);
Generate the <li>
elements for a Bootstrap navigation menu
$args['echo']
bool
Echo or return the output. Default istrue
$args['start']
int
Start at level #. Default isnull
$args['depth']
int
Stop at level #. Default is2
Generate Bootstrap styled breadcrumbs
$args['echo']
bool
Echo or return the output. Default istrue
Generate <title>
$args['echo']
bool
Echo or return the output. Default istrue
$args['home']
string
String to overwrite home title. Default isnull
$args['sep']
string
Separator. Default is›
Generate <h1>
, <h2>
etc
$args['echo']
bool
Echo or return the output. Default istrue
$args['tag']
string
Heading tag. Default ish1
$args['caption']
string
Subtitle inside<h>
. Default isXysti::page('caption')
$args['a']
bool
Include<a>
tags. Default isfalse
$args['href']
string
href of<a>
. Default isURI::current()
$args['title']
string
The heading title. Default isXysti::page('title')
Generate a Bootstrap styled button
$args['echo']
bool
Echo or return the output. Default istrue
$args['class']
string
Additional classes. Default isnull
$args['tag']
string
<a>
,<input type="submit"
or<input type="button"
. Default isa
$args['value']
string
Button value. Default is ``$args['href']
string
Button link. Default is#
$args['target']
string
Link target. Default isfalse
$args['icon']
string
Bootstrap / Font Awesome icon. Default isdownload-alt
$args['after']
string
Output after. Default is ``
Generate Bootstrap styled buttons for Xysti downloads
$download_keys
array
An array of Xysti download keys
Generate Bootstrap styled thumbnails
$args['echo']
bool
Echo or return the output. Default istrue
$args['ul']
bool
Wrap in<ul>
. Default istrue
$args['span']
int
Thumbnail width. Default is3
$args['lightbox']
bool
rel="lightbox". Default istrue
$args['tooltip']
bool
rel="tooltip". Default istrue
$args['timthumb']
bool
Run timthumb on each img. Default isfalse
$args['imgs']
array
Array of images (merged with $imgs). Default isarray()
$imgs[]['href']
string
Thumbnail link. Default is$img['src']
$imgs[]['span']
int
Thumbnail width. Default is$args['span']
$imgs[]['title']
string
Title attribute. Default isfalse
$imgs[]['full']
string
data-full attribute. Default isfalse
Generate a TimThumb link
$args['w']
intWidth. Default is
false`$args['h']
intWidth. Default is
false`$args['span']
intOverride width with Bootstrap span. Default is
false`$args['src']
string` Img src relative to timthumb. Default is ``$args['wh']
intSet width or height for lightbox. Default is
false`
Generate Bootstrap style alerts from session data
$args['echo']
bool
Echo or return the output. Default istrue
$args['dismiss']
bool
Allow dismiss. Default istrue