Skip to content

Commit

Permalink
[TASK] Update the Extension manual
Browse files Browse the repository at this point in the history
  • Loading branch information
astehlik committed May 14, 2019
1 parent 6050d79 commit c898785
Show file tree
Hide file tree
Showing 14 changed files with 233 additions and 284 deletions.
131 changes: 0 additions & 131 deletions Documentation/Administrator/Index.rst

This file was deleted.

109 changes: 57 additions & 52 deletions Documentation/Configuration/Index.rst
Original file line number Diff line number Diff line change
@@ -1,79 +1,84 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: ../Includes.txt
.. include:: ../Includes.txt


.. _configuration:

=============
Configuration
=============

.. _configuration-rendering:

Rendering
---------

The rendering mechanism of this extension is very flexible since all the rendering is done with TypoScript.
Have a look at ``Configuration/TypoScript/setup.txt`` and it will probably remind you of the setup of
``css_styled_content``.

.. _configuration-rendering-accessing-data:
.. _configuration-manage-providers:

Accessing data
~~~~~~~~~~~~~~
Manage providers
================

But there is something special in the TypoScript configuration because we somehow need to access the
data of the the provider, the request and the response. This is why there is a new ``getText`` type available
called ``registerobj``. With this type you are able to access register data like you can do with the register type.
Providers are managed via TypoScript in :typoscript:`plugin.tx_mediaoembed.settings.providers`.

The new thing about ``registerobj`` is, that you can access object getters and array data. To do that simply
use the pipe character (|) like you know it from the GP type for example.
There are two ways of configuring matching URLs of an provider: regular expressions or simple wildcard based schmemes.

All relevant data for the oEmbed rendering is stored in a single register called tx_mediaoembed which is an
object of the type ``Sto\Mediaoembed\Content\RegisterData`` array that contains 4 child objects:
Regular Expressions
-------------------

::
To make the handling of URLs simpler we use # as the regex delimer.

Sto\Mediaoembed\Content\Configuration
Sto\Mediaoembed\Request\Provider
Sto\Mediaoembed\Request\HttpRequest
Sto\Mediaoembed\Response\GenericResponse
This is an example configuration using Regular Expressions:

With the new ``getText`` type you can access all public available getter Methods of these object.

For a complete documentation of all available methods please have a look in the code or use PHPDoc
to generate API documentation. In the future, the most important methods will also be documented here.
.. code-block:: typoscript
If a method returns an array you can traverse the array by using the pipe character.
plugin.tx_mediaoembed.settings.providers {
some_provider {
endpoint = https://some-provider.tld/oembed/endpoint
urlRegexes {
10 = #https?://([a-z0-9-]+\.)?myprovider\.(org|de|dk)/embedvideo/.*#i
20 = #https?://([a-z0-9-]+\.)?myprovider\.(org|de|dk)/embedimage/.*#i
}
}
}
Wildcards
---------

Example
```````
A simpler approach is the usage of wildcards. In that case the config option is called urlSchemes
and not urlRegexes:

.. code-block:: typoscript
video = TEXT
video.data = registerobj : tx_mediaoembed|response|html
The above TypoScript snippet will call these PHP methods to retrieve the data:
plugin.tx_mediaoembed.settings.providers {
some_provider {
endpoint = https://some-provider.tld/oembed/endpoint
urlSchemes {
10 = https://*.myprovider.org/embedvideo/*
20 = https://*.myprovider.org/embedimage/*
}
}
}
.. code-block:: php
It provides less flexibility than regex but it is easier to handle.

Sto\Mediaoembed\Content\RegisterData->getResponse()->getHtml()

.. _configuration-rendering:

.. _configuration-function-reference:

Function reference
------------------
Rendering
=========

TODO: Document the most important getter methods.
The Extension uses the default Extbase template mechanisms for rendering.

.. _configuration-extending-it:
This means you can add your own template and partials paths to the configuration to overwrite
the templates that come with this Extension:

Extending it
------------
.. code-block:: typoscript
TODO: Document how this extension can be extended.
plugin.tx_mediaoembed {
view {
templateRootPaths {
0 = EXT:mediaoembed/Resources/Private/Templates/
1 = EXT:mysitepackage/Resources/Private/Templates/
}
partialRootPaths {
0 = EXT:mediaoembed/Resources/Private/Partials/
1 = EXT:mysitepackage/Resources/Private/Partials/
}
}
}
See also: :ref:`t3extbasebook:view`
Binary file modified Documentation/Images/ScreenshotContentElement.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Documentation/Images/ScreenshotInstallToolUpdates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Documentation/Images/ScreenshotProviderForm.png
Binary file not shown.
Binary file removed Documentation/Images/ScreenshotProviderList.png
Binary file not shown.
79 changes: 41 additions & 38 deletions Documentation/Index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. include:: Includes.txt

.. include:: Includes.txt

.. Every manual should have a start label for cross-referencing to
.. start page. Do not remove this!
.. _start:

Expand All @@ -14,49 +12,54 @@ mediaoembed

.. only:: html

:Version:
|release|
:Classification:
mediaoembed

:Language:
en
:Version:
|release|

:Description:
Manual covering TYPO3 extension mediaoembed
:Language:
en

:Keywords:
oembed, video, audio, image, youtube, flickr, external
:Description:
Manual covering TYPO3 extension mediaoembed

:Copyright:
2014
:Keywords:
oembed, video, audio, image, youtube, flickr, external

:Author:
Alexander Stehlik
:Copyright:
2013-2019

:Email:
[email protected]
:Author:
Alexander Stehlik

:License:
This document is published under the Open Content License
available from http://www.opencontent.org/opl.shtml
:Email:
[email protected]

:Rendered:
|today|
:License:
This document is published under the Open Publication License
available from http://www.opencontent.org/openpub/

The content of this document is related to TYPO3,
a GNU/GPL CMS/Framework available from `www.typo3.org <http://www.typo3.org/>`_.
:Rendered:
|today|

The content of this document is related to TYPO3,
a GNU/GPL CMS/Framework available from `www.typo3.org <https://typo3.org/>`__.

**Table of Contents**

**Table of Contents**

.. toctree::
:maxdepth: 5
:titlesonly:
:glob:

Introduction/Index
UsersManual/Index
Administrator/Index
Configuration/Index
KnownProblems/Index
ToDoList/Index
Targets
:maxdepth: 3


Introduction/Index
User/Index
Installation/Index
Configuration/Index
Developer/Index
KnownProblems/Index
ToDoList/Index
ChangeLog/Index
Support/Index
Links
Loading

0 comments on commit c898785

Please sign in to comment.