Git Product home page Git Product logo

ssrigging-contactbits's Introduction

SilverStripe Contact Bits

Easily fits your SiteConfig/Page/DataObject with generic contact info, saving you a bunch of boring typing.

##Requirements

  • Silverstripe 3.1

##Installation

  • Simply drop into silverstripe root (using whatever method)
  • dev/build
  • ?flush=all

##Usage Apply the extension to your DataObject (of whatever type), then dev/build & relax.

###Example This is a usecase for a small local business and requires the cms module. mysite/_config/contactbits.yml:

SiteConfig:
  extensions:
    - ContactBits
	
ContactBits:
  hide:
    - TollFree
    - Fax
    - Postal
));

Which can then be rendered in the site's footer simply via templates/Page.ss: <% include ContactBits %>

##About This is a common need on websites, and the pattern of inclusion is usually the same; if they're filled in, use them in the template, otherwise don't. This made for not only very similar looking SiteConfig extensions to appear in each site, but a lot of if statements in the template. This module helps speed things up.

##Notes

  • Don't forget to run dev/build to apply your new db fields after adding the extension to your object.
  • Different configurations (ie. of hidden fields) can be created through subclassing the extension and applying the different (sub)classes to their different intended 'owners'. Everything still works as intended. This allows for eg. in a corporate group a 'main' toll free number and no postal info applied to SiteConfig, and a DataObject for each branch with post info but local phone numbers only.

ssrigging-contactbits's People

Contributors

nightjar 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.