brotkrueml / schema

TYPO3 extension providing an API and view helpers for schema.org markup

Home Page:https://extensions.typo3.org/extension/schema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide a cObject to generate schema from within TypoScript

DanielSiepmann opened this issue · comments

Is your feature request related to a problem? Please describe.

A customer wants to use your extension but generate the Schema from within TypoScript instead of Fluid.
Reasons are:

  • Inherit configuration from parent pages. E.g. define "WebPage" once and auto generate on all sub pages.
  • Fetching of data as known by integrator via TypoScript, independent of Content Elements and Fluid. E.g. use typolink or use data to retrieve info from page, CE, URL, Site, etc.
  • Allow for usage of conditions (stdWrap.if).
  • Separate Schema Generation from actual frontend output if it is not to much related.
  • Allow separate files defining actual schema generation, e.g. separate TypoScript files which will be imported by base setup.

Describe the solution you'd like

A new cObject SCHEMA which takes the necessary configuration and adds types to the existing JSON-LD output.

Describe alternatives you've considered

Existing ways like Fluid ViewHelpers or PHP API. But those don't cover our reasons, see above.

Teachability, Documentation, Adoption, Migration Strategy

Integrators can add the following TypoScript:

31 = SCHEMA
31 {
    if {
        equals.data = site : rootPageId
        value.field = uid
    }
    type = WebSite
    properties {
        url {
            typolink {
                parameter = t3://page?uid={field : uid}
                parameter.insertData = 1
                forceAbsoluteUrl = 1
                returnLast = url
            }
        }
        name.field = seo_title // title
        description.field = description
        publisher = SCHEMA
        publisher {
            id {
                typolink {
                    parameter = t3://page?uid={site : rootPageId}#organization
                    parameter.insertData = 1
                    forceAbsoluteUrl = 1
                    returnLast = url
                }
            }
        }

        potentialAction = SCHEMA
        potentialAction {
            type = SearchAction
            properties {
                target = SCHEMA
                target {
                    type = EntryPoint
                    properties {
                        urlTemplate {
                            typolink {
                                // TODO: Insert search page uid
                                parameter = t3://page?uid=5&q=
                                forceAbsoluteUrl = 1
                                returnLast = url
                            }
                            append = TEXT
                            append.value = {search_term_string}
                        }
                    }
                }
                query-input = required name=search_term_string
            }
        }
    }
}

Additional context

Nothing additional.