Coder Social home page Coder Social logo

helpfulrobot / martimiz-silverstripe-translatablegooglesitemaps Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drmartingonzo/silverstripe-translatablegooglesitemaps

0.0 2.0 1.0 8 KB

Extension to the GoogleSitemaps module for sites using the Translatable module

License: Other

PHP 79.76% Scheme 20.24%

martimiz-silverstripe-translatablegooglesitemaps's Introduction

TranslatableGoogleSitemap module for SilverStripe CMS

Note: This module is considered beta: working, but not thorougly tested. Comments/issues welcome!

Introduction

Provide multilanguage support in GoogleSitemaps, including alternatives, for sites using the Translatable module. It follows the Google requiremnts explained here:

Sitemaps: rel="alternate" hreflang="x"

Usage

Copy to your Website root, using any name you want, then do a ?flush=1 to renew your YAML files and templates (If the proper template doesn't seem to be used, try a flush=1 on sitemap.xml as well).

Locales

by default the pages' Locale property ('en_US', 'nl_NL') will be used to generate the alternatives for each page in the sitemap. You can define some locales as generic for a given language, so that for instance en is presented to english spoken users, instead of en_US.

In your _config/translatablegooglesitemaps.yml:

---
Name: translatablegooglesitemaps
---
TranslatableGoogleSitemap:
  generic_locales:
    en_US: en
    nl_NL: nl

Sitemap size

By default in GoogleSitemaps, the max number of pages in a single sitemap is set to 1000. Since the language alternatives for translated pages add substantially to the sitemap source, you might want to turn that down a bit for large sites:

In your GoogleSitemaps module, in _config/googlesitemaps.yml:

---
Name: googlesitemaps
---
  ...
  objects_per_sitemap: 1000

Requirements

  • SilverStripe Framework 3.0+ and CMS 3.0+
  • SilverStripe Translatable module
  • Silverstripe GoogleSitemaps module

Note: works with the SilverStripe LanguagePrefix module

Maintainers

  • Martine Bloem (Martimiz)

Please report any bugs or issues you may find

martimiz-silverstripe-translatablegooglesitemaps's People

Contributors

martimiz avatar

Watchers

 avatar  avatar

Forkers

timezoneone

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.