Skip to content
Nicolas Liautaud edited this page Oct 22, 2017 · 5 revisions

p01contact is natively a plugin for Pico CMS.

This page describe features implemented from version 1.1 of p01contact.

Installation

Download or clone the repository, then place the p01-contact/ directory in plugins/.

Usage in pages

Just write tags in your pages according to the [syntax].

---
Title: My contact page
Description: Contact me
---

This is a default contact form :
    
(% contact %)
    
Simple.

Usage in themes and templates

The contact Twig function creates contact forms. Without parameters, it will output a default form as defined in the [settings]. Parameters can be added to create form-specific structures (see [syntax]) and localization.

{{ contact() }}                   output the default form
{{ contact('parameters') }}       custom parameters
{{ contact('fr', 'parameters') }} custom parameters and form-specific language
{{ contact('fr', null) }}         default form with form-specific language

Configuration

A functional configuration panel to manage the plugin settings can be shown with the (% contact_admin_config %) tag and contact_admin Twig function.

This panel shouldn't be accessible in production by visitors or not trusted users. You can create a specific page for this panel, restricted to logged administrators, by using Pico Users Plugin.

(% contact_admin_config %)     in pages
{{ contact_admin('config') }}  in themes

Similarly, the global debug report that are enabled with the Debug setting can be placed in a custom page or in theme with the following tags.

(% contact_admin_debug %)      in pages
{{ contact_admin('debug') }}   in themes
Clone this wiki locally