Download the PHP package portrino/px_semantic without Composer

On this page you can find all versions of the php package portrino/px_semantic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package px_semantic

px_semantic 2.5.0 (beta)

Latest Stable Version Total Downloads

Structured Data Markup Rendering for TYPO3 with JSON-LD

PxSemantic provides an extrem dynamic and highly customizable solution to embed structured data on your website and enrich them with information about your website. The currently supported classes are a subset of the vocabulary defined on https://schema.org/ and were generated with the schema generator from https://api-platform.com/. At the moment we only support json-ld format to encode LinkedData.

Before you start:

Example 1 - Render Organization Information

For example you want to markup your official website with information about your corporate contacts (https://developers.google.com/structured-data/customize/contact-points) you can do it this way:

Declare your organization information and corporate contact via TypoScript.

TypoScript:

lib.structuredDataMarkupOrganization < lib.structuredDataMarkup
lib.structuredDataMarkupOrganization {
    settings {
        entity = Portrino\PxSemantic\SchemaOrg\Organization
        processors {
            # processor to set properties of an entity via TypoScript
            0 {
                className = Portrino\PxSemantic\Processor\TypoScriptProcessor
                settings {
                    # for string values you do not have to use TEXT datatype, you can just write "key = value"
                    # US, GB, DE
                    areaServed = DE

                    contactPoint {
                        # "customer support", "technical support", "billing support", ...
                        contactType = customer support
                        telephone = +49-123-456-78
                    }

                    logo {
                        # get the logo image uri via TS and prepend the baseUrl to get the absolute path
                        url = IMG_RESOURCE
                        url {
                            file = fileadmin/company_logo.png
                            stdWrap.wrap = {TSFE:baseUrl}|
                            stdWrap.insertData = 1
                        }
                    }
                    # special datatype from px_semantic EXT to define arrays
                    sameAs = Portrino\PxSemantic\Converter\ArrayConverter
                    sameAs {
                        0 = http://www.facebook.com/yourSite/
                        1 = http://www.youtube.com/user/yourSite/
                        2 = http://www.pinterest.com/yourSite/
                    }
                    # use typolink to generate link to the root page
                    url = TEXT
                    url.typolink {
                        parameter = 1
                        returnLast = url
                    }
                }
            }
        }
    }
}


Use the TS to render the resulting JSON-LD code somewhere on your website. We put it into the <HEAD> because other meta information are also located within the <HEAD> tag. But it doesn`t matter.

Google says:

You can embed data in a web page using schema.org field names and the new JSON-LD data format. JSON-LD is easy to produce with many widely available JSON encoders. The data, enclosed within the <script type="application/ld+json"> ... </script> tags as shown in the examples below, may be placed in either the

or region of the page that displays that event. Either way, it won't affect how your document appears in users' web browsers. -- [Google Documentation][1]
TypoScript:


page.headerData.1453734422 < lib.structuredDataMarkupOrganization


If you want to put it in your template you could make use fluids cObject-ViewHelper:

Fluid:

This will result in the following JSON-LD Markup on your page

Example 2 - Render Multiple Entities

TypoScript:


    lib.structuredDataMarkupExample < lib.structuredDataMarkup
    lib.structuredDataMarkupExample {
        settings {
            entity {
                className = Portrino\PxSemantic\SchemaOrg\Question

                id = TEXT
                id.data = field:uid
            }
            processors {
                0 {
                    className = Portrino\PxSemantic\Processor\ExampleProcessor
                }
            }
        }
    }

Fluid:

Example 3 - Create LinkedData REST API

Since version 2.0.0 it is possible to configure an LinkedData REST API which is based on Hydra Core Vocabulary (http://www.hydra-cg.com/spec/latest/core/)

TypoScript:

constants.txt


plugin.tx_pxsemantic {
    settings {
            rest {
                pid = 123
            }
        }
    }        
}

setup.txt


plugin.tx_pxsemantic {
    settings {
            rest {
                endpoints {
                    pages {
                        entity = Portrino\PxSemantic\SchemaOrg\CreativeWork
                        resource = Portrino\PxSemantic\Domain\Model\Page
                        processors {
                            0 {
                                className = Portrino\PxSemantic\Processor\PageProcessor
                            }
                        }
                    }
                }
            }
        }
    }        
}

realurl_conf.php


...

  'fixedPostVars' => [
        '_DEFAULT' => [],
        'api' => [
            [
                'GETvar' => 'type',
                'valueMap' => [
                    'structured-data' => 1475825939,
                    'structured-data-contexts' => 1476721757,
                    'vocab' => 1476770090
                ]
            ],
            [
                'GETvar' => 'tx_pxsemantic_hydraapi[endpoint]',
                'valueMap' => [
                    'recipes' => 'recipes',
                    'pages' => 'pages'
                ],
                'noMatch' => 'bypass'
            ],
            [
                'GETvar' => 'tx_pxsemantic_hydracontext[context]',
                'valueMap' => [
                    'Entrypoint' => 'Entrypoint',
                ],
                'noMatch' => 'bypass'
            ],
            [
                'cond'        => [
                    'prevValueInList' => 'pages'
                ],
                'GETvar'      => 'tx_pxsemantic_hydraapi[uid]',
                'lookUpTable' => [
                    'table'       => 'pages',
                    'id_field'    => 'uid',
                    'alias_field' => 'uid'
                ],
                'optional'    => true
            ]
        ],
        '123' => 'api'
    ],

...

More Examples

See also the list of contributors who participated in this project.


All versions of px_semantic with dependencies

PHP Build Version
Package Version
Requires php Version >= 5.5.0, <= 7.1.99
typo3/cms-core Version >= 6.2.16, <= 8.7.99
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package portrino/px_semantic contains the following files

Loading the files please wait ....