GithubHelp home page GithubHelp logo

siteadvice / c5_custom_contact_form Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jasteele12/c5_custom_contact_form

1.0 2.0 0.0 79 KB

Basic example of a custom form block for the Concrete5 CMS -- a good starting point for creating your own custom forms, and IMHO a better approach than the built-in "external_form" block.

c5_custom_contact_form's Introduction

Custom Contact Form

A very basic contact form block that you can use as a starting point for creating your own custom form blocks with Concrete5. In my experience, this is a better solution than using the built-in "external_form" block as it does not suffer from many of the limitations of that approach (for example, see http://www.concrete5.org/community/forums/chat/external-form-with-own-controller/ -- or just search the forums for "external_form" to find other potential issues).

Installation / Customization

  1. Move the custom_contact_form directory from this repo's blocks directory to your site's top-level blocks directory (note: this is just a block, not a package -- so don't put it in your packages directory).
  2. Rename the custom_contact_form directory as desired (should be the lowercase_and_underscore version of your block's name -- for example, "My Great Form" would get a directory name of "my_great_form").
  3. Edit the controller.php file:
    • Change the class name to be a TitleCaseWithNoSpaces version of the block name (otherwise known as CamelCase), followed by BlockController -- for example, "My Great Form" would get a class name of MyGreatFormBlockController.
    • Change the block name and description. It is recommended that the name correspond with the directory and class names, but this is not a technical requirement (just avoids confusion).
    • Change the table name to bt followed by the CamelCase version of the block name -- for example, "My Great Form" would get a table name of btMyGreatForm.
  4. Edit db.xml file so the table name matches what you set in controller.php.
  5. Customize the form as needed. The view.php file contains the form html. The action_submit_form() method in controller.php responds to form submissions.

c5_custom_contact_form's People

Contributors

jordanlev avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.