You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently a template is defined by having eg a Template/Tag/MatomoAnalytics.php and Template/Tag/MatomoAnalytics.web.js file. We could make this potentially easier although it also has some drawbacks.
We could make it as easy as in the simplest case let developers only define a file eg Template/Tag/MatomoAnalytics.web.js where the ID would be extracted from the file name as MatomoAnalytics and the name be Matomo Analytics. It would be also possible to define a translation with the translation key PluginName_MatomoAnalytics. Because it ends with .web.js we would know it is for the web context and it would be placed in the Others category.
However, it is recommended to define a description, possibly help, parameters, ... and therefore we should require developers to also define like a JSON file Template/Tag/MatomoAnalytics.json. The format be like: {id: "MatomoAnalytics", name: "PluginName_MatomoAnalytics", description: "foo bar", help: "foo bar", context: ["web"], order: 999, category: "Page View", logo: "...", parameters: [{key: "idSite", "name": "Site ID", type: "string", uiControl: "text", validators: ["NotEmpty", "UrlLike"]....}]}
However there are obviously a few downsides. For example there is no auto completion (in PHP there are constants), there is a lot more documentation needed and in JSON it is much easier to introduce typos etc because of this. Also we would likely need to document both ways the PHP and JSON way and having two ways to do the same thing is not always ideal. As there might be cases where you still need PHP, it would be the preferred way to use PHP from the beginning.
The text was updated successfully, but these errors were encountered:
Eg if `$_GET['date']=today` is set, but `$_POST['date] = '';` then it might still trigger an exception like this otherwise:
> There was an error while regenerating container releases: Date format must be: YYYY-MM-DD, or 'today' or 'yesterday' or any keyword supported by the strtotime function (see http://php.net/strtotime for more information): #0 core/Date.php(148): Piwik\Date::getInvalidDateFormatException(false) #1 /core/Plugin/Controller.php(640): Piwik\Date::factory(false) #2 /core/Plugin/Controller.php(607): Piwik\Plugin\Controller->setGeneralVariablesViewAs(Object(Piwik\View), 'basic') #3 /plugins/TagManager/Controller.php(205): Piwik\Plugin\Controller->setGeneralVariablesView(Object(Piwik\View)) #4 /plugins/TagManager/Controller.php(53): Piwik\Plugins\TagManager\Controller->renderTemplate('@TagManager/deb...') #5 [internal function]: Piwik\Plugins\TagManager\Controller->debug() #6 /var/www/html/core/FrontController.php(590): call_user_func_array(Array, Array) #7 /core/FrontController.php
(165): Piwik\FrontController->doDispatch('TagManager', 'debug', Array) #8 plugins/TagManager/Context/WebContext/JavaScriptTagManagerLoader.php(72): Piwik\FrontController->dispatch('TagManager', 'debug') #9 /plugins/TagManager/Context/WebContext.php(166): Piwik\Plugins\TagManager\Context\WebContext\JavaScriptTagManagerLoader->getPreviewJsContent() #10
Currently a template is defined by having eg a
Template/Tag/MatomoAnalytics.php
andTemplate/Tag/MatomoAnalytics.web.js
file. We could make this potentially easier although it also has some drawbacks.We could make it as easy as in the simplest case let developers only define a file eg
Template/Tag/MatomoAnalytics.web.js
where the ID would be extracted from the file name asMatomoAnalytics
and the name beMatomo Analytics
. It would be also possible to define a translation with the translation keyPluginName_MatomoAnalytics
. Because it ends with.web.js
we would know it is for theweb
context and it would be placed in theOthers
category.However, it is recommended to define a description, possibly help, parameters, ... and therefore we should require developers to also define like a JSON file
Template/Tag/MatomoAnalytics.json
. The format be like:{id: "MatomoAnalytics", name: "PluginName_MatomoAnalytics", description: "foo bar", help: "foo bar", context: ["web"], order: 999, category: "Page View", logo: "...", parameters: [{key: "idSite", "name": "Site ID", type: "string", uiControl: "text", validators: ["NotEmpty", "UrlLike"]....}]}
However there are obviously a few downsides. For example there is no auto completion (in PHP there are constants), there is a lot more documentation needed and in JSON it is much easier to introduce typos etc because of this. Also we would likely need to document both ways the PHP and JSON way and having two ways to do the same thing is not always ideal. As there might be cases where you still need PHP, it would be the preferred way to use PHP from the beginning.
The text was updated successfully, but these errors were encountered: