Code Monkey home page Code Monkey logo

seo's Introduction

seo

This module enables advanced SEO functions for Silverstripe. It providers an SEO editor with

  1. Instant Previews for Google, Facebook, Twitter
  2. Editor for Open Graph Data
  3. Editor for Twitter Cards
  4. Save taxonomies
  5. Various meta title templates for pages
  6. Robots.txt controller
  7. Canonical URL management
  8. Flexibility on extending

Maintainers

[email protected]

Installation

Use composer to install on your SilverStripe 4 website.

composer require silverstripers/seo dev-master

Requirements

  1. SilverStripe 4+
  2. SilverStripe Reports
  3. SilverStripe Assets

Basic usage

Require the package via composer and run dev build. http://mysite.com/dev/build?flush=all The module will create additional SEO fields for the SiteTree (page) objects and will add in an interface for set up the SEO data.

Add the following instead of the SilverStripe's default meta tag in the <head> section of your template.

$GenerateMetaTags.RAW

DataObjects as pages

If you are using data objects as pages then you may need to add in SEO fields for those data objects to do that it needs to decorate the data object with SEODataExtension

MyDataObject:
    extensions:
        SilverStripers\SEO\Extension\SEODataExtension

This will create the db fields and add the seo editor on to the CMS.

Within the controller you need to call override_seo_from function, and pass your data record for the module to grab the SEO details

use SilverStripers\SEO\Extension\SEODataExtension
...

class MyController extension Controller {

    ...

    public function view()
    {
        ...
        SEODataExtension::override_seo_from($record);
        ...
    }

}

Variables / Taxonomies

If you login to the CMS and go to Settings -> SEO -> Variables, there is a grid field where you can enter name value pair objects. These can have any names and any values and for any text field within the meta editor you can use these.

The variables will have respective buttons to click which will add them automatically on to the editors fields.

You can also type them in like this. {MyVariableName}

Meta Title Templates

For various websites there are different types of web pages which needs various types of meta titles.

eg: A product page will have a meta title like: ABC Product - Create the best value for money | XYZ Company

Meta titles templates lets you define these as

{MetaTitle} - Create the best value for money | {SiteTitle}

This then get the meta title from the page's meta title variable, and site title from the Site Config title. You can also use any of the variables you defined in the variables sections.

Structured Data

The module supports structured data and enabling takes only a few yml configurations.

E.G: The following makes a Page a Thing and maps the fields on to the Database fields.

Page:
  schema_type: 'Thing'
  schema:
    'name': 'MetaTitle'
    'description': 'MetaDescription'
    'Image': 'FacebookImage'

Supported Types

  • Article
  • Beach
  • BlogPosting
  • BreadcrumbList
  • ContactPoint
  • Corporation
  • CreativeWork
  • Duration
  • Event
  • GeoCoordinates
  • ImageObject
  • Invoice
  • ListItem
  • LocalBusiness
  • MusicAlbum
  • MusicGroup
  • MusicPlaylist
  • MusicRecording
  • NewsArticle
  • Offer
  • Order
  • Organization
  • Person
  • Place
  • PostalAddress
  • PriceSpeficication
  • Product
  • Rating
  • Review
  • SearchBox
  • Thing
  • VideoObject
  • WebPage

To view the config options for any type visit the page with adding ?structureddata_help=1 to the end of the URL

Enjoy!!

seo's People

Contributors

baukezwaan avatar christohill avatar drmartingonzo avatar ethanjohnstone avatar fonsekaean avatar kdanilewicz avatar prameshharshana3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

seo's Issues

Maybe should be placed after Content ?

Great looking module, congratulations !
I was just wondering if it might not be better to add the SEO panels after the Content textarea instead of before ? Seems more logical that way.
What do you think ?

Can not choose image from assets

Hi there,

trying to choose an image for e.g. facebook results in a js error:
Uncaught Error: Could not find "store" in either the context or props of "Connect(t)". Either wrap the root component in a , or explicitly pass "store" as a prop to "Connect(t)".

This occurs with the latest SS Version 4.2.1 in the backend.

Any ideas / solutions?

Kind regards
Holger

Support for fluent

This module can't be used in conjunction with fluent apparently.
I checked the database. Fields are only added to SiteTree and not to SiteTree localised tables. So data isn't saved to the db.

Module fields not appearing in SilverStripe 5

That issue has already been reported but not properly fixed so reposting.
Both my last installs on SS5 have that issue, none of the SS4 (6 of them) have that error, so it's clearly a SS5 issue.

See how the fields (don't actually) appear

Brave BrowserSnapz003
Brave BrowserSnapz002

Conflict with SiteTreeSubsites class

Hi, I got the following Notice when using subsites:
Array to String conversion in vendor\silverstripe\subsites\src\Extensions\SiteTreeSubsites.php

After changing $tags in the MetaTags method of SiteTreeSubsites class from string to array I managed to fix this. It would be nice to have support for subsites without editing the SiteTreeSubsites class.

Cheers,

Dennis

installed module out the box - getting error

Installed the module out the box with composer and have added the $GenerateMetaTags.RAW into my head.ss but getting this error constantly

[Emergency] Uncaught Exception: Type Article is not found within the Schema.org types

Improvement

The circles behind the PageTitles in the site structure are a nice way to encourage users to make the SEO good for a page. However, it is not always clear why a red/yellow circle remains. Even if all the fields are filled and no hints are given, the circles are still not all green.

Proposed solution:

  • repeat the circles in the 'Meta Data & SEO' tab and use words to explain how the score can get to 100%

Or it is a bug that 100% cannot be achieved. But I can't check what's missing, so either way it would be a nice improvement.

Meta Title and Meta Keywords are not saving

The Meta Title and Meta Keywords are not saving.
It says: "You have not set a meta title."
Even I've already added the title.

php: 7.4.22
mysql: 8.0.3
silverstripers/seo: latest
os: windows 11

Rendering the OG data

Hi there - this is a great looking module, well done!

I have installed but the OG data is not rendering on the page - is there an include/addition needed in page.ss?

cheers

James

silverstripe 5 version not working

Will there be a silverstripe 5 compatible version? Installing dev-maser is working on ss5, but the seoeditor fields are not showing up.
Scherm­afbeelding 2023-05-22 om 12 02 47

Social image picker won't close

When selecting a different image for Facebook/Twitter, clicking the X or the backdrop doesn't close the file picker.

This is confirmed to be an issue on Silverstripe versions 4.7 to 4.10 (unsure if any prior versions are affected).
This is using the master branch of this module.

Improvement: make the colored circles in SiteTree navigation optional

Nice work on this module, works great out of the box.

One thing that would make me even like it more, is to have an option to hide the colored circles in the sitetree with pages. Although they give a nice visual hint of the SEO-improvements, they are quite in your face (especially for the not-so-imporant pages, like a container-page or 404-page).

Would be nice to make this optional by a YML-setting for instance.

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.