Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This module should switch to prebuilt views for display of the user and node stat pages. This would allow a lot more customization once in the users hands and integration with other views plugins and modules!
It would also make theming these pages easy peasy!
Thoughts?
Comment | File | Size | Author |
---|---|---|---|
#7 | statistics_page_settings-1902668-7.patch | 4 KB | patrickd |
Comments
Comment #1
patrickd CreditAttribution: patrickd commentedSounds good, if it's easy to implement I'd do it..
Would you create and export a view with this configuration?
Comment #2
infines CreditAttribution: infines commentedI haven't jumped into the views end of the module yet, but I will try and let you know If I need access to things within views.
Comment #3
infines CreditAttribution: infines commentedThis is going well, the only issue I'm running into is that users will have to have a field on their entity type called field_day, field_year, field_month, field_week, etc...
So once we do away with the current pages, I will probably have to write up some documentation explaining how to access these views, and leave them disabled on install. That way the end user won't receive errors because of missing fields.
Let me know if you have any thoughts on this plan!
Comment #4
patrickd CreditAttribution: patrickd commentedI'm a bit concerned how to make an update path for this functionality...
the only way to add this in without crushing the functionality of existing sites would be to make the use of views optional and leave the stat pages as they are by default..
or we have to programatically decide when and which views to display, depending on the fields...
so there has to be a view generated for each field attached to a node..
also we have to add views as real dependency
this changes are bigger than I thought, is the flexibility we get worth this?
what's the usecase to change the content of the stat-per-node pages?
Comment #5
infines CreditAttribution: infines commentedI had a thought about this also, and I came up with this.
Option 1: We could implement these views into a submodule called Piwik Statistics Views. Then the views can override the current pages. I'll make them extremely pretty. Then Views will only be required for the submodule, and it'll be a great way to show the power of the module when combined with views.
Option 2: When and if the module is rebuilt theoretically the module will just pull in the data from Piwik and not load it into specific fields. It will all be pulled by views and again, optional submodule for people who aren't very good with views. For people who are, they can just build their own.
Option 3: Move the pages functionality to an optional submodule, called Piwik Statistics Pages. People can then decide if they want to enable prebuilt pages for their module or utilize views. This way people can either use node/_NODEID_/piwik page or they can build a view and use their own path, settings, extra fields to customize the way they want it without overwriting the old page or having two pages.
I honestly think Option 3 is the best option for now, with Option 2 obviously happening in the future for load concerns.
If you think of any more options or something let me know. I'd like to continue this discussion and get it right for everyone.
Comment #6
patrickd CreditAttribution: patrickd commentedInstead of putting the pages functionality into a separate module, why not just add the option to disable these pages?
That way you can also move to views if necessary.
I think that would fix this problem easiest, or is there something against this?
Comment #7
patrickd CreditAttribution: patrickd commentedPlease check the following patch:
- Only show the statistics page tab when there is at least one piwik_stats field
- Added new fields setting 'Show on "Piwik statistics page"' to set whether a field should be listed on the statistics page (TRUE for default)
- If all fields are set to not show on statistics page, the complete statistics page will be hidden
After applying the patch you need to run update.php to refresh the settings.
I think this solves your problem and also gets a lot of new flexibility in for low efforts
Comment #8
infines CreditAttribution: infines commentedI'll test this patch tonight. But it looks good. I'll also be writing some documentation on using one of the many graphing modules with this. I'll keep you updated.
Comment #9
infines CreditAttribution: infines commentedWorks great!
Comment #10
patrickd CreditAttribution: patrickd commentedpushed to 7.x-2.x!
thanks! :)
Comment #11
infines CreditAttribution: infines commentedPerhaps it is time for a 2.0 release or perhaps a beta3? What are the release blockers for this?
Comment #12
patrickd CreditAttribution: patrickd commentedNo blockers, I just don't want to make a new release after every single commit ;-)
But yes, it's about time, I'll create a beta3