<commit_before># SilverStripe gallerist Module

Gallerist is a highly adaptable gallery module for SilverStripe.

## Maintainer Contact

<NAME> (charden) <http://charden.se/>

Author: <NAME> <<EMAIL>>

## Requirements

 * PHP: 5.2.4+ minimum.
 * SilverStripe: 2.4.4 minimum (previous versions has never been tested).

## Installation Instructions

 * Place this directory in the root of your SilverStripe installation. Make sure
   that the folder is named "gallerist" if you are planning to run the unit tests.

 * Visit http://www.yoursite.example.com/dev/build?flush=all to rebuild the
   manifest and database.

## Usage Overview

### Adding Gallerist CMSFields to selected Page types

In order to use Gallerist it must be activated for the SiteTree subclasses
where a gallery can be displayed. The easiest scenario is activating it for
Page which makes it available for all Page types:

    class Page extends SiteTree {
        // Gallerist looks for a public property named gallerist_active
        // in order to determine if it should be available for the
        // Page type.
        public static $gallerist_active = true;
    }

Changing $gallerist_active to false in a subclass would disable Gallerist for
that subclass (and its subclasses). Activation and deactivation can also be done
using Object::set_static(...) which is nice when dealing with a third party
module:

    Object::set_static('UserDefinedForm', 'gallerist_active', true);

### Modifying your theme

#### Templates

Adding $Gallerist to your template will render any gallery items for the current
page using the default gallerist template which can be found in
gallerist/templates/Include/Gallerist.ss. It is possible to override the
default template in two ways:

 * Create webroot/themes/yourtheme_gallerist/templates/Include/Gallerist.ss
   which will have priority over the default template.

 * Change the template name which Gallerist looks for:
   
       Object::set_static('GalleristPageDecorator', 'markup_template', 'Name');

Gallerist will also render gallerist/templates/Include/Gallerist_Css.ss which
is a CSS template. It sets the width and height of the gallery.

By default the Gallerist container will occupy the maximum width of its parent
HTML element (display: block, width: auto) and have the height of the shortest
image in the gallery.

Add the public methods GalleristImageWidth()/GalleristImageHeight() to the page
type showing the gallery to override the default width/height calculation:

    class TestPage extends Page {
        public function GalleristImageHeight() {
            // Always use a height of 280px on TestPages.
            return 280;<commit_msg>Fixing an error in README.md.<commit_after># SilverStripe gallerist Module

Gallerist is a highly adaptable gallery module for SilverStripe.

## Maintainer Contact

<NAME> (charden) <http://charden.se/>

Author: <NAME> <<EMAIL>>

## Requirements

 * PHP: 5.2.4+ minimum.
 * SilverStripe: 2.4.4 minimum (previous versions has never been tested).

## Installation Instructions

 * Place this directory in the root of your SilverStripe installation. Make sure
   that the folder is named "gallerist" if you are planning to run the unit tests.

 * Visit http://www.yoursite.example.com/dev/build?flush=all to rebuild the
   manifest and database.

## Usage Overview

### Adding Gallerist CMSFields to selected Page types

In order to use Gallerist it must be activated for the SiteTree subclasses
where a gallery can be displayed. The easiest scenario is activating it for
Page which makes it available for all Page types:

    class Page extends SiteTree {
        // Gallerist looks for a public property named gallerist_active
        // in order to determine if it should be available for the
        // Page type.
        public static $gallerist_active = true;
    }

Changing $gallerist_active to false in a subclass would disable Gallerist for
that subclass (and its subclasses). Activation and deactivation can also be done
using Object::add_static_var(...) which is nice when dealing with a third party
module:

    Object::add_static_var('UserDefinedForm', 'gallerist_active', true, true);

### Modifying your theme

#### Templates

Adding $Gallerist to your template will render any gallery items for the current
page using the default gallerist template which can be found in
gallerist/templates/Include/Gallerist.ss. It is possible to override the
default template in two ways:

 * Create webroot/themes/yourtheme_gallerist/templates/Include/Gallerist.ss
   which will have priority over the default template.

 * Change the template name which Gallerist looks for:
   
       Object::set_static('GalleristPageDecorator', 'markup_template', 'Name');

Gallerist will also render gallerist/templates/Include/Gallerist_Css.ss which
is a CSS template. It sets the width and height of the gallery.

By default the Gallerist container will occupy the maximum width of its parent
HTML element (display: block, width: auto) and have the height of the shortest
image in the gallery.

Add the public methods GalleristImageWidth()/GalleristImageHeight() to the page
type showing the gallery to override the default width/height calculation:

    class TestPage extends Page {
        public function GalleristImageHeight() {
            // Always use a height of 280px on TestPages.
            return 280;
{'fraction_non_alphanumeric': 0.061895910780669146, 'fraction_numerical': 0.0044609665427509295, 'mean_word_length': 3.99165120593692, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4566019', 'n_tokens_mistral': 1467, 'n_tokens_neox': 1403, 'n_words': 658}