New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various Api Improvements #10665
Various Api Improvements #10665
Conversation
<div piwik-content-block content-title="Piwik.org Blog"> | ||
<div piwik-widget-loader='{"module":"RssWidget","action":"rssPiwik"}'></div> | ||
</div> | ||
<div piwik-widget-loader='{"module":"RssWidget","action":"rssPiwik"}'></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we can see the benefit of rendering widget headlines automatically now, we do not have to define the title twice, we automatically use the widget title defined in the widget
} | ||
|
||
if (strpos($content, 'piwik-content-block') === false | ||
&& strpos($content, 'class="card"') === false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might not detect in all cases whether someone is using the card css class manually but developers should not do this anyway, they should use piwik-content-block. So it's fine if someone was using class=" card test"
return true; | ||
} | ||
|
||
return widget.viewDataTable && (widget.viewDataTable === 'tableAllColumns' || widget.viewDataTable === 'sparklines' || widget.viewDataTable === 'graphEvolution'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we always display them full width
The changes were needed in order to make some plugins compatible with Piwik 3:
Background: By default, when there are two widgets on one page, the layout will automatically show them next to each other. However, sometimes a widget might need to be shown full width even when there is more than one widget on a page. I found "wide" better than "full width" property as we might not show it full width
Segment.addSegments
similar toWidget.addWidgetConfigs
,Report.addReports
, etc&showtitle=1
) and the widget does not define it, it will automatically make a card with a title out of the widget. This ensures the widget will be shown properly in the dashboard and somewhere else. Otherwise the developer would need to handle this manually and detect whether it is shown in the reporting UI and depending on this render content differently etc.placeholder
androws
The changes are all in one PR as I'm making some plugins compatible and I need all the changes together in order to make them compatible.