You can install from the market place by searching for "arcane seo" or:
$ cd /path/to/project-root/
$ git clone [email protected]:mstrrain/Arcane-SEO.git plugins/arcane/seo
$ php artisan plugin:refresh Arcane.Seo
$ composer update
To enable meta tags, place the SEO component in one or more of your layouts. Make sure meta tags are enabled from the settings page.
SEO meta tag fields support twig syntax, this makes them more flexible when you have a website with many records and you need to use their attribute values for search results, or generate the title and description of the page from a model field.
The twig syntax is very helpful, it allows you to do something like this:
{{ "This is the meta title of my page" | _ }}
After rendering the page the first time, the string will be registered by the RainLab.Translate
's _
filter as a translation message. This means that these meta tags can become multilingual.
- Sitemap.xml fields don't use dynamic fields.
- If you are using only one
{{ }}
inside a the property field of a schema.org component, you need to add at least one trailing space, from the code of the page not the October interface. Example:
[schemaVideo]
description = "{{ episode.serie.summary }} " <-- this is the trailing space
To automatically generate the sitemap.xml, follow the steps below:
-
Make sure you have the sitemap.xml enabled in the settings page.
-
Go to the editor page of your CMS, static or blog post page, and on the "SEO" tab check the "Enable in the sitemap.xml" checkbox.
-
Visit: http(s)://yourdomain.tld/sitemap.xml
Note: The fields in the "Sitemap" section are not dynamic.
If you have a custom model that you want to generate the links from, add the full class name of your model in the "Settings" tab of the CMS page. If the page has the blogPost
component, you don't need to set the Model class.
Important: The URL parameters of the page, for example: /post/:slug
, will be replaced by the attribute values of the model with the same name, so you must ensure the model has an attribute called slug
in this case.
You can write your own schemas on your cms pages, blog posts and static pages. Just locate the Schema tab and follow this syntax:
# top level schema
Article:
# these are properties
headline: "BIG NEWS OF 2019"
# property names must be written exactly as schema.org
datePublished: "09/08/1992"
# You can specify the type of subschema like this
publisher@Organization:
# properties are dynamic
name: "{{ model.publisher.name }}"
# you can specify arrays of a type
author@Person[]:
0:
name: "James"
1:
name: "Tom"
# another top level schema
Organization:
...
The plugin also comes with components that define some schema.org objects (Article, Product and VideoObject). These components are also available as snippets for RainLab.Pages
and their properties support twig syntax.
It's highly recommended that you read the Google guidelines if you're not familiar with structured data.
To use these components, all you need to do is drag the ones you need from the inspector to the page editor. Do not place them inside the page code as they are rendered by the seo
component.
Important: component field values enclosed in {{ }}
are automatically interpreted by October as external properties (https://octobercms.com/docs/cms/components#external-property-values). If you have only one brace pair, then the output will be an empty string if October can't find the external property. As a workaround, You must add a trailing space like this:
However, if using multiple braces you won't need to add any space.
Note: The components will be removed in a later version.
The configuration is done via the Open Graph tab. If you don't know about these tags read the guide for Open Graph from Facebook and the guide for Twitter cards from Twitter.
Note: Twitter cards are automatically set from the OG * fields.
Currently supported tags are:
og:title
defaults to page meta_title | page titleog:description
defaults to page meta_description | site description in the Settings pageog:image
defaults to page image|site image in Settings page - Open Graph tabog:type
defaults to "website"og:site_name
set in the settings page.twitter:title
fromog:title
twitter:description
fromog:description
twitter:image
fromog:image
Note: read the guidelines from Facebook and Twitter linked above for recommended values on these tags.