Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 864 Bytes

File metadata and controls

55 lines (40 loc) · 864 Bytes

SilverStripe CSE PageMap

Provides ability to add Google CSE PageMap data to a SilverStripe template

Installation (with composer)

$ composer require heyday/silverstripe-cse-pagemap:~0.1

Usage

Implement the provided interface

class MyPageType extends Page implements CsePageMapInterface
{
    public function getPageMap()
    {
        return array(
            'page' => array(
                'type' => get_class($this)
            )
        );
    }
}

Add the provided extension to the applicable class

mysite/_config.php

Object::add_extension('MyPageType', 'CsePageMapExtension');

Add the PageMap to the head of your html

Page_Head.ss

<head>
<!--
$PageMap
-->
</head>

Unit testing

silverstripe-cse-pagemap/ $ composer install --dev
silverstripe-cse-pagemap/ $ phpunit