Skip to content

WPP-Public/akqa-nz-silverstripe-cse-pagemap

Repository files navigation

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

About

Allows the setting of Google CSE PageMap data in templates

Resources

Stars

Watchers

Forks

Packages

No packages published