XMF Cookbook
  • Introduction
  • XMF Cookbook
  • Basic Ingredients
    • Namespaces
    • Autoloading
    • Debugging
    • Forward Compatibility
  • Recipes
    • Introducing Module Helpers
    • Using the Permission Helper
      • Checking Permissions
      • Managing Item Permissions
    • Using the Session Helper
    • Using JSON Web Tokens
    • Altering Database Tables
    • Migrating a Module's Database
    • Loading Initial Data
    • Module Admin Pages
      • Hide and Seek with Icons
      • Standard Admin Pages
    • Manage Metadata
    • Highlighting Content
  • Reference
    • Assert
      • Assertions
    • Database
      • Migrate
      • TableLoad
      • Tables
        • Getting Started
        • Table Operations
        • Working with Columns
        • Working with Indexes
        • Changing Table Data
        • Interacting with the Work Queue
        • Error Info and Debugging
    • Debug
    • FilterInput
    • Highlighter
    • IPAddress
    • Jwt
      • JsonWebToken
      • KeyFactory
      • TokenFactory
      • TokenReader
    • Key
      • ArrayStorage
      • Basic
      • FileStorage
      • KeyAbstract
      • StorageInterface
    • Language
    • Metagen
      • Extracting Data
      • Applying Data
    • Module
      • Admin
      • Helper
      • Helper
        • AbstractHelper
        • Cache
        • GenericHelper
        • Permission
        • Session
    • ProxyCheck
    • Random
    • Request
    • StopWords
    • Uuid
    • Yaml
  • Credits
  • License:
  • Table of Content
Powered by GitBook
On this page
  • Metagen::assignTitle($title);
  • Metagen::assignKeywords($keywords)
  • Metagen::assignDescription($description)
  • Metagen::generateMetaTags($title, $body)
  1. Reference
  2. Metagen

Applying Data

Metagen::assignTitle($title);

Set the page title tag to $title.

Metagen::assignKeywords($keywords)

Set the meta keywords tag with using the array of keywords in $keywords.

Metagen::assignDescription($description)

Set the meta description tag to $description.

Metagen::generateMetaTags($title, $body)

Full form:

Metagen::generateMetaTags(*$title*, *$body*, *$count*, *$minLength*, *$wordCount*, *$forceKeys*)

Generate and assign title, keywords and description meta tags, taking the title from $title, extracting the keywords and description from $body.

The maximum number of key words is $count, which defaults to 20. Only words at least $minlen, which defaults to 4, will be considered.

No more than $wordCount words, default is 100, will be included in the description.

If specified, the array of words in $forceKeys will be used as keywords. Those words will count toward the $count.

PreviousExtracting DataNextModule

Last updated 7 years ago