ilateral\SilverStripe\GoogleShoppingFeed\GoogleShoppingFeed
Shopping Feeds are a way to tell Google about pages on your site that they might not otherwise discover. In its simplest terms, a XML Sitemap usually called a Sitemap, with a capital S—is a list of the pages on your website.
Creating and submitting a Sitemap helps make sure that Google knows about
all the pages on your site, including URLs that may not be discoverable by
Google's normal crawling process.
The GoogleSitemap handle requests to 'sitemap.xml'
the other two classes are used to render the sitemap.
You can notify ("ping") Google about a changed sitemap
automatically whenever a new page is published or unpublished.
By default, Google is not notified, and will pick up your new
sitemap whenever the GoogleBot visits your website.
To Enable notification of Google after every publish set google_notification_enabled
to true in the googlesitemaps.yml config file.
This file is usually located in the _config folder of your project folder.
e.g mysite/_config/googlesitemaps.yml
<example>
---
Name: customgooglesitemaps
After: googlesitemaps
---
GoogleSitemap:
enabled: true
google_notification_enabled: true
use_show_in_search: true
</example>
Synopsis
- // members
- private static array $dataobjects = ;
- // methods
- public static bool is_registered()
- public static void clear_registered_dataobjects()
- public static ArrayList getItems()
- public static ArrayList get_items()
- public static string get_frequency_for_class()
- public static boolean enabled()
Tasks
Line | Task |
---|---|
112 | migrate to extension hook or DI point for other modules to |
Members
private
- $dataobjects
—
array
List of {@link DataObject} class names to include.
Methods
public
- clear_registered_dataobjects() — Clears registered {@link DataObjects}. Useful for unit tests.
- enabled() — Is GoogleSitemap enabled?
- getItems() — Constructs the list of data to include in the rendered feed. Links can include pages from the website, dataobjects (such as forum posts) as well as custom registered paths.
- get_frequency_for_class() — Returns the string frequency of edits for a particular dataobject class.
- get_items() — Static interface to instance level ->getItems() for backward compatibility.
- is_registered() — Checks whether the given class name is already registered or not.