- Issue created by @toprak
- πΊπΈUnited States bluegeek9
Hi @toprak,
I understand your concern about exposing data to users.
The node report is still created with SQL queries and a table render array is constructed. Visitors created reporters this way until recently. Now, most of the reports are using views. There are a few issues left before Visitors are exclusively using views.
Visitors still use custom Controllers to display reports. I think I will use the path as the contextual filter, create the path, e.g. node/12 in the controller, and pass it to the view. Adding a contextual filter for the entity ID is an interesting idea. I am still learning field plugins so it may be a while before I learn contextual filters.
π Replicate or replace /node/*/visitors with a view Active
π Replace visitors/referers with Views Active Hi @bluegeek9,
Thanks for reply.
Actually I want to leave the core statistics module(deprecated in Drupal 10.3) and use visitor in most future projects.
I know it's a different perspective but the scenario requires it. Currently, "path" way in contextual filter is not solution to filter "specific node" data in views.Since it is not filtered, all other visit data comes through as well.
I guess I have no choice but to wait for the next updates for the scenario above...
I am also following the related issues. If I can create a solution, I will share it.
Thanks again.- πΊπΈUnited States bluegeek9
I am finishing up replacing the Node report with a view. I created the path string in the Report controller and passed it to the view.
"Content ID from URL" will return just an integer. This will not work.
We could create a default argument plugin for the path like there is for Query parameters. It would be the current path, but the form will have the option to remove x number of items
So 'node/10/visitors' with a 1 would filter for 'node/10'.
A text field should be added to append to the path optionally, allowing you to filter for 'node/10/edit'.
PS
I added β¨ core statistics: migrate view count Active . If the Core Statistics view count could be migrated, would you move existing projects to Visitors? Of course, why not. The reason for preference here is that it offers more features than the core statistic module. Maybe, there is also the concern that these features may cause performance problems compared to the core statistic module. But, I haven't encountered any problems in my current tests.
As for ID (integer), take a look at the core statistic or node view count modules. They do a good job with ID.
I had tried the Path&Query method before, but I tried it again. Unfortunately, it doesn't work.
Ex : node/10/new-visits
No result.Why did I mention the ID point? The reason is;
Let's say we will filter only the data belonging to node 10.
I embed the following view into the node twig.
{{ drupal_view('visitors_recent_visits', 'embed_1') }} or {{ drupal_view('visitors_recent_visits', 'block_5') }}.
Or using a view block working with path&query filter.
I tried different filters or path and query parameters, it doesn't work.
Or maybe I missed it.But if there was an ID option, I could customize the data I wanted and show it in twig, in block or with a different url..
Anyway, I really respect your work and approach. I guess there's nothing to do. I will try to move forward with your path.- Assigned to bluegeek9
- Merge request !155Issue #3459758 by bluegeek9: Views Contextual filter: current path and route β (Merged) created by bluegeek9
-
bluegeek9 β
committed 8c779625 on 8.x-2.x
Issue #3459758: Views Contextual filter: current path and route
-
bluegeek9 β
committed 8c779625 on 8.x-2.x
Automatically closed - issue fixed for 2 weeks with no activity.