Skip to content

quangtrongonline/Arcane-SEO

Repository files navigation

Arcane SEO banner

Installation

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

How to use

Meta tags

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.

Dynamic meta tags

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.

seo fields screenshot

RainLab.Translate support

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.

Restrictions

  • 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

Automating the sitemap.xml

To automatically generate the sitemap.xml, follow the steps below:

  1. Make sure you have the sitemap.xml enabled in the settings page.

    enable sitemap.xml in settings page screenshot

  2. 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.

    sitemap checkbox screenshot

  3. Visit: http(s):https://yourdomain.tld/sitemap.xml

Note: The fields in the "Sitemap" section are not dynamic.

Custom models

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.

model class field screenshot

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.

Adding structured data (schema.org)

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.

structured data component screenshot

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:

trailing space at the end of the value

However, if using multiple braces you won't need to add any space.

Note: The components will be removed in a later version.

Open Graph & Twitter cards

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.

open graph tab screenshot

Currently supported tags are:

  • og:titledefaults to page meta_title | page title
  • og:description defaults to page meta_description | site description in the Settings page
  • og:image defaults to page image|site image in Settings page - Open Graph tab
  • og:type defaults to "website"
  • og:site_name set in the settings page.
  • twitter:title from og:title
  • twitter:description from og:description
  • twitter:image from og:image

Note: read the guidelines from Facebook and Twitter linked above for recommended values on these tags.

About

Advanced SEO plugin for OctoberCMS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published