Coder Social home page Coder Social logo

helpfulrobot / weboftalent-page-with-image Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gordonbanderson/page-with-image

0.0 2.0 0.0 21 KB

SilverStripe module to show folders of pages with attached images

License: BSD 3-Clause "New" or "Revised" License

PHP 96.61% Scheme 3.39%

weboftalent-page-with-image's Introduction

Page With Image

Build Status Scrutinizer Code Quality Code Coverage Build Status codecov.io

Latest Stable Version Latest Unstable Version Total Downloads License Monthly Downloads Daily Downloads

Dependency Status Reference Status

codecov.io

Maintainers

##Introduction

This module provides for rendering subpages as images of folders, which themselves can contain similar folders. Images can also be attached to third party module page types and rendered in the same way.

##Documentation

Provided Page Types

A PageWithImage is container within a PageWithImageFolder. Both are the same as a standard Page, but with the addition of a main image (MainImage field).

Extending Provided Page Types

One can simply extend PageWithImage adding whatever is needed for the subclass as appropriate.

class AnimalPage extends PageWithImage {
	private static $db = array('Name' => 'Varchar');
}

The above class AnimalPage will appear when right clicking on a PageWithImageFolder to add a new subpage.

Using the AddImageExtension

There are 2 configuration changes required for a Page type that does not already have an attached image.

  • Add the AddImageExtension
  • Allow the third party Page type be a child of PageWithImageFolder (otherwise you can't add it) To do this add a config file, say pagewithimage.yml in your own module or mysite/_config directory with YML as per the following:
---
Name: yoursitepagewithimage
After: pagewithimage
---
PageWithImageFolder:
  allowed_children:
    - PageWithImage
    - ThirdPartyPage
ThirdPartyPage:
  extensions:
    - AddImageExtension

Repeat for each ThirdPartyPage type that you would like to have an image.

##Requirements

  • SilverStripe 3.1

##TODO

  • Tests

weboftalent-page-with-image's People

Contributors

gordonbanderson avatar

Watchers

James Cloos avatar helpfulrobot 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.