Code Monkey home page Code Monkey logo

grav-theme's People

Contributors

vuurtorenjeroen avatar

Watchers

 avatar  avatar

grav-theme's Issues

Forms plugin is not supported

The problem

The Forms plugin currently does not work. This needs to be fixed before the new website can go live.

The solution

There are two ways to solve this:

  1. Import a default form renderer.
  2. Create a custom form renderer.

Import a default form renderer

The default form can be imported using below line, but it renders a very ugly, unstyled form. This can be fixed with CSS, but maybe we should take control of the rendering ourselves (see solution 2)

{% include "forms/form.html.twig" %}

Create a custom form renderer

A better way is to render our own forms. The documentation describes this rather thoroughly, so we should be able to implement that, but it takes more time.

It does give us an advantage as we can then share those forms across pages rather easily, rendering forms in popups then suddenly becomes possible.

Using this method, you can choose a specific name of a form to display. You can even provide the name of a form defined in other pages. As long as all your form names are unique throughout your site, Grav will find and render the correct form!

A workaround

As long as this issue isn't resolved, users can enable Twig rendering and plop in the form themselves, but I'm not entirely sure that's such a great idea.

The workaround is explained in the docs too, but it's fairly ugly.

---
title: Page with Forms
process:
  twig: true
cache_enable: false
---

<!-- Render form -->
{% include "forms/form.html.twig" %}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.