PHP Класс Craft\SeomaticService

Наследование: extends craft\BaseApplicationComponent
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$cachedCreator
$cachedCreatorJSONLD
$cachedIdentity
$cachedIdentityJSONLD
$cachedMainEntityOfPageJSONLD
$cachedProductJSONLD
$cachedSettings
$cachedSiteMeta
$cachedSocial
$cachedWebSiteJSONLD
$entryMeta
$entrySeoCommerceVariants
$lastElement
$renderedMetaVars

Открытые методы

Метод Описание
convertTimes ( &$value, $timezone = null ) Loops through the data and converts the times to DateTime objects.
encodeEmailAddress ( $emailAddress ) * -------------------------------------------------------------------------------- Encode an email address as ordinal values to obfuscate it to bots --------------------------------------------------------------------------------
extractKeywords ( $text = null, $limit = 15, $withoutStopWords = true ) * -------------------------------------------------------------------------------- Extract the most important words from the passed in text via TextRank --------------------------------------------------------------------------------
extractSummary ( $text = null, $limit = null, $withoutStopWords = true ) * -------------------------------------------------------------------------------- Extract a summary from the text, or if it's not long enough, just return the text --------------------------------------------------------------------------------
extractTextFromMatrix ( $matrixBlocks, $fieldHandle = "" ) * -------------------------------------------------------------------------------- Extract text from a matrix field --------------------------------------------------------------------------------
extractTextFromNeo ( $neoBlocks, $fieldHandle = "" ) * -------------------------------------------------------------------------------- Extract text from a Neo field --------------------------------------------------------------------------------
extractTextFromTags ( $tags ) * -------------------------------------------------------------------------------- Extract text from a tags field --------------------------------------------------------------------------------
getBreadcrumbsJSONLD ( $crumbs ) * -------------------------------------------------------------------------------- Get the Breadcrumbs JSON-LD --------------------------------------------------------------------------------
getCreator ( $locale ) * -------------------------------------------------------------------------------- Get the Creator record We do it this way so that there is only one DB query to load in all of the SEOmatic settings. Originally there were 4 separate models & 4 DB queries.
getCreatorJSONLD ( $creator, $helper, $locale ) * -------------------------------------------------------------------------------- Get the Creator JSON-LD --------------------------------------------------------------------------------
getDefaultBreadcrumbs ( $meta ) * -------------------------------------------------------------------------------- Get the default breadcrumbs.
getFullyQualifiedUrl ( $url ) * -------------------------------------------------------------------------------- Get a fully qualified URL based on the siteUrl, if no scheme/host is present --------------------------------------------------------------------------------
getGlobals ( $forTemplate = "", $locale ) * -------------------------------------------------------------------------------- Get the seomatic globals --------------------------------------------------------------------------------
getIdentity ( $locale ) * -------------------------------------------------------------------------------- Get the Identity record We do it this way so that there is only one DB query to load in all of the SEOmatic settings. Originally there were 4 separate models & 4 DB queries.
getIdentityJSONLD ( $identity, $helper, $locale ) * -------------------------------------------------------------------------------- Get the Identity JSON-LD --------------------------------------------------------------------------------
getLocalizedUrls ( ) * -------------------------------------------------------------------------------- Returns an array of localized URLs for the current request --------------------------------------------------------------------------------
getMainEntityOfPageJSONLD ( $meta, $identity, $locale, $isMainEntityOfPage ) * -------------------------------------------------------------------------------- Get the Main Entity of Page JSON-LD --------------------------------------------------------------------------------
getMeta ( $forTemplate = "" ) * -------------------------------------------------------------------------------- Get the meta record --------------------------------------------------------------------------------
getMetaById ( $metaId, $locale = null ) * -------------------------------------------------------------------------------- Returns a meta by its ID --------------------------------------------------------------------------------
getMetaFromElement ( $element ) * -------------------------------------------------------------------------------- Try to extract an seomaticMeta field from an element --------------------------------------------------------------------------------
getProductJSONLD ( $meta, $identity, $locale ) * -------------------------------------------------------------------------------- Get the Product JSON-LD --------------------------------------------------------------------------------
getSettings ( $locale ) * -------------------------------------------------------------------------------- Get the Settings record We do it this way so that there is only one DB query to load in all of the SEOmatic settings. Originally there were 4 separate models & 4 DB queries.
getSiteMeta ( $locale ) * -------------------------------------------------------------------------------- Get the siteMeta record We do it this way so that there is only one DB query to load in all of the SEOmatic settings. Originally there were 4 separate models & 4 DB queries.
getSocial ( $locale ) * -------------------------------------------------------------------------------- Get the social record We do it this way so that there is only one DB query to load in all of the SEOmatic settings. Originally there were 4 separate models & 4 DB queries.
getTextFromEntryField ( $srcField ) * -------------------------------------------------------------------------------- Extract text from a generix field, do different things based on the classHandle --------------------------------------------------------------------------------
getTransformsList ( ) * -------------------------------------------------------------------------------- Returns an array of transforms defined in the system --------------------------------------------------------------------------------
getWebSiteJSONLD ( $metaVars, $locale ) * -------------------------------------------------------------------------------- Get the WebSite JSON-LD --------------------------------------------------------------------------------
headlessRenderSiteMeta ( $templatePath = "", $entry = null, $forTemplate = "", $locale ) * -------------------------------------------------------------------------------- Render the all of the SEO Meta for a "headless" instance of Craft $templatePath - the template to use to render the meta, "" for the default $entry - the Entry ElementType for this render, null otherwise $forTemplate - the Craft template path for this request, e.g. "blog/index" $locale - the locale for this render --------------------------------------------------------------------------------
humanFileSize ( $size ) * -------------------------------------------------------------------------------- Return a human-readable file size --------------------------------------------------------------------------------
isFieldHandleInEntry ( $entryElement = null, $fieldHandle = "" ) * -------------------------------------------------------------------------------- Is a given fieldHandle in a entry? --------------------------------------------------------------------------------
parseAsTemplate ( $templateStr, $element ) * -------------------------------------------------------------------------------- Parse the passed in $templateStr as an object template, with $element passed in --------------------------------------------------------------------------------
render ( $templatePath = "", $metaVars = null, $isPreview = false ) * -------------------------------------------------------------------------------- Render the SEOmatic template --------------------------------------------------------------------------------
renderBreadcrumbs ( $metaVars, $locale, $isPreview = false ) * -------------------------------------------------------------------------------- Render the Breadcrumbs JSON-LD --------------------------------------------------------------------------------
renderDisplayPreview ( $templateName = "", $metaVars ) * -------------------------------------------------------------------------------- Render the SEOmatic display preview template --------------------------------------------------------------------------------
renderGlobals ( $metaVars, $forTemplate = "" ) * -------------------------------------------------------------------------------- Render the SEOmatic globals --------------------------------------------------------------------------------
renderGoogleAnalytics ( $metaVars, $locale, $isPreview = false ) * -------------------------------------------------------------------------------- Render the Google Analytics