Skip to content

A simple templating(tpl) system for pico that allows you to include html templates in your pico theme(s)

Notifications You must be signed in to change notification settings

michaelhettwer/pico_tpl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 

Repository files navigation

pico_tpl

A simple dynamic content system for pico template that allows you to include html /.md files specfically created for use in theme in your pico theme(s)

Installation

  1. Copy the plugin file/folder the plugins directory of your Pico site.
  2. Open the pico config.php and insert add and config['tpl_array'] = array('header','content','footer','cover','sidebar') change for your theme.
  3. Create a tpl folder in your theme folder and add you content.html files to it.
  4. You can use twig's include function to load tpl(s) {% include tpl.content ignore missing %} the plugin will load your pagename-content.html or content.html if that file does not exist, missing files are simple ignored
  5. Create a tpl folder in your theme folder and add you content.html files to it
  6. Views -- you can create place reusable html twig snippets in the views folder add {% include views.filename ignore missing %} to you theme, and you have a simple way to re-use html files.

Samples

https://gist.github.com/shawnsandy/6150969

License

Released under the MIT license.

Copyright (c)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A simple templating(tpl) system for pico that allows you to include html templates in your pico theme(s)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%