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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

patrickd’s picture

Version: 7.x-2.0-beta2 » 7.x-2.x-dev
Priority: Critical » Normal

Sounds good, if it's easy to implement I'd do it..

Would you create and export a view with this configuration?

infines’s picture

Assigned: Unassigned » infines

I 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.

infines’s picture

This 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!

patrickd’s picture

I'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?

infines’s picture

I 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.

patrickd’s picture

Instead 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?

patrickd’s picture

Status: Active » Needs review
FileSize
4 KB

Please 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

infines’s picture

I'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.

infines’s picture

Status: Needs review » Reviewed & tested by the community

Works great!

patrickd’s picture

Title: Utilize Views for node and user stat pages! » Make visibility of fields in the statistics page configurable
Status: Reviewed & tested by the community » Fixed

pushed to 7.x-2.x!

thanks! :)

infines’s picture

Perhaps it is time for a 2.0 release or perhaps a beta3? What are the release blockers for this?

patrickd’s picture

No 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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.