OK, I will try it.
Hello
Does it not count the homepage?
Also, can it calculation a total count of all pages count? That is, to accumulate the counts of all pages. It will display a counter, which is the sum of all pages.
Thank you for this feature update.
Thank you for your suggestion. I have created an issue about using glossify for Chinese fonts, but unfortunately, I do not have enough knowledge to create a module.
msn5158 → created an issue.
Ok
msn5158 → created an issue.
However, for chinese font, it is not very friendly because chinese characters do not have spaces to separate them.
I'm not requesting a solution to this issue, I just feel a bit regretful because I'm looking for a similar module.
3.0.3 version back to normal
Perhaps this is currently the best solution, thank you very much.
msn5158 → created an issue.
You mean is: close the "Run cron every" to never on page /admin/config/system/cron
, Then setup automatic execution of cron tasks by Drush for 0 0 * * * /path/to/project/vendor/bin/drush core:cron
I don't know how to install Drush and configure it.
Is it a global installation or a project-based installation.
After installation, I don't know how to configure it.
When using it, I cannot use like this: drush core:cron
, I must use it like this: vendor/bin/drush core:cron
SELECT value FROM key_value WHERE name = 'statistics.day_timestamp';
+---------------+
| value |
+---------------+
| i:1725167477; |
+---------------+
1 row in set (0.001 sec)
1725167477 = 2024-09-01 13:11:17 Beijing Time
From here, it can be seen that its reset time today is 2024-09-02 13:11:17, then I refreshed the page after 13:12, The day-counter has not been reset. However, when I click to "Run Cron" on 2024-09-02 13:12:55, then refresh the page again, the counter was reset. Then, its next reset time becomes 2024-09-03 13:12:55, Look, it is 13:12:55 not 13:11:17.
Now, I execute the statement again: SELECT value FROM key_value WHERE name = 'statistics.day_timestamp';
+---------------+
| value |
+---------------+
| i:1725253975; |
+---------------+
1 row in set (0.010 sec)
1725253975 = 2024-09-02 13:12:55 Beijing Time
Conclusion, the day counter is not reset according to the time zone.
It starts calculating the next reset time (24 hours) is: When it reaches the reset time and after "Run Cron", It will reset the current day counter and calculates the next day reset time.
Exactly how do you run cron ? Is it just the "Automated Cron" module in core ? Or something else ?
I only setup this, please see the picture. I didn't add like these:
"30 * * * * web_user /var/www/html/vendor/bin/drupal ..."
Sometimes I manually click on "Run Cron"
.
SELECT value FROM key_value WHERE name = 'system.cron_last';
+---------------+
| value |
+---------------+
| i:1725251119; |
+---------------+
1 row in set (0.063 sec)
1725251119 = 2024-09-02 12:25:19 Beijing Time
SELECT value FROM key_value WHERE name = 'statistics.day_timestamp';
+---------------+
| value |
+---------------+
| i:1725167477; |
+---------------+
1 row in set (0.001 sec)
1725167477 = 2024-09-01 13:11:17 Beijing Time
Today's reset time is 20:50, The daily reset time seems to be different.
Never mind, it's not very important either.
Thank you for taking the time to answer my question.
When the international time UTC is 00:00, then my server local time is 08:00
However, the reset time of the counter is between 17:00-18:00
/etc/timezone >> I have set this file to UTC, But it didn't solve the problem
I use statistics by Drupal Core, Is it related to this?
I flashed the page at 17:58 and saw it reset. It should have been reset between 17:00-18:00
root@:~# date
Wed 28 Aug 2024 11:05:14 AM CST
root@:~# date --utc
Wed 28 Aug 2024 03:05:00 AM UTC
SELECT * FROM `node_counter`order by `timestamp` desc limit 10;
+------+------------+----------+------------+-----------+------------+-----------+
| nid | totalcount | daycount | timestamp | weekcount | monthcount | yearcount |
+------+------------+----------+------------+-----------+------------+-----------+
| 3326 | 211 | 0 | 1724665745 | 5 | 31 | 228 |
| 1998 | 2887 | 0 | 1724662728 | 1 | 414 | 2888 |
| 7613 | 290 | 0 | 1724662660 | 4 | 44 | 310 |
| 5530 | 328 | 0 | 1724652530 | 1 | 25 | 335 |
| 2062 | 169 | 0 | 1724563551 | 2 | 37 | 190 |
| 9492 | 289 | 0 | 1724563080 | 2 | 40 | 302 |
| 5529 | 3159 | 0 | 1724560171 | 0 | 88 | 1585 |
| 8896 | 139 | 0 | 1724558069 | 0 | 22 | 152 |
| 5930 | 8366 | 0 | 1724557960 | 1 | 273 | 4191 |
| 8621 | 164 | 0 | 1724557443 | 0 | 20 | 168 |
+------+------------+----------+------------+-----------+------------+-----------+
10 rows in set (0.057 sec)
drush sget system.cron_last
I haven't installed Drush yet, but I have set the cron run schedule task to once per hour
OS version: Debian GNU/Linux 11 (bullseye) x86_64(Py3.7.9)
The Drupal version: 10.2.7
The database server version: MariaDB 10.11.6-MariaDB-log - Source distribution
The PHP version and SAPI (apache2, fcgi/fpm, cli, ...): 8.2.19
The Apache configuration, especially vhost file: I use nginx 1.26.0
There are some information that I don't know how to obtain.
Also, I'm not sure exactly when it will be reset, but it's not 00:00. I'm currently observing.
I installed this module: statistics_counter →
I updated the time zone in PHP.ini, restarted the server and PHP, but it still hasn't cleared at the correct time. I don't know where the problem lies.
Thank you so much, however, it was placed in the wrong position.
Test drupal version: 10.2.7
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
Thank you, Solved.
msn5158 → created an issue.
I also have the same problem, But I don't know how to use the patch.
Steps to reproduce:
1.Choose token option from Provide a default value (in the context filter of the view).
2.Enter a token or leave it blank.
3.Open a non-existent page on the browser.
4.No 404 page returned, The page encountered an error: The website encountered an unexpected error. Try again later.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
The first image outputs the content normally.
https://www.drupal.org/files/issues/2024-08-09/screencapture-domain-hast... →
The second image selects editablefields as the field formatting program, using default settings. For authorized users, it becomes editable fields. However, for users who have not logged in, that is, unauthenticated users, the basic display of content is missing.
https://www.drupal.org/files/issues/2024-08-09/screencapture-domain-hast... →
The third image, with the 'Bypass access check' option selected, the visitor still cannot see the content.
https://www.drupal.org/files/issues/2024-08-09/screencapture-domain-hast... →
What I mean is that visitors cannot edit fields, but they should be able to see the basic content, just like using the default formatting program.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
I tried it and it seems to be effective.
However, there are two issues:
1.Will this website be shut down someday in the future?
2.Will using it in this way bring security risks to the website?
I suggest the moderator consider this feature, at least it reduces the CPU surge, targeted prefetching of URLs
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
Yes, I have found it. Thank you
Additionally, If the article has already been published, all value options in the field cannot be freely arranged in order again.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
Thank you, I want to ask, what does this mean? {node}, is it node.nid?
msn5158 → created an issue.
Also, what mechanism does it use to clear count? I just encountered an inexplicable problem where the statistical count suddenly disappeared, all become 0, apart from the total count.
msn5158 → created an issue.
In addition, there's a question,
Edit in Node:
<h2>This is the Twig template from the node</h2>
<h2>I can use {{ '{{ node.nid.value }} = ' ~ node.nid.value }}</h2>
{{ dump() }}
Edit in custom block library:
<h2>This is the Twig template from custom block library</h2>
<h2>I can use {{ '{{ block_content.id.value }} = ' ~ block_content.id.value }}</h2>
<h2>But, I can't use {{ '{{ node.nid.value }} in custom block library (it will nothing print): ' ~ node.nid.value }}</h2>
<h2>What should I do to achieve it like this</h2>
{{ dump() }}
See the picture:
How do I use the node Twig template in a custom block library, How to import for use?
Thank you.
After testing, it wasn't can't use tokens and Twig, It only can't obtain contextual data for the current page.
When enabling AJAX:
The global token is working properly: such as [site:name]
, but not include [current-page:title]
of current page.
Twig is working normally: such as {{ drupal_breadcrumb() }}
, but not include {{ drupal_title() }}
to get current page title.
Yes, I am using this module and inline_formatter_field → .
What I mean is, it cannot retrieve data from the current page context if enable io ajax.
AJAX not enabled, available Twig in inline_formatter_field of custom block: {{ drupal_title() }}
and {{ path('<current>') }}
, They work normally and meet expectations.
But, if ajax enabled, {{ drupal_title() }}
unable to obtain the current page title, and {{ path('<current>') }}
get the incorrect path (/io/block), not the current page path (/mypath/123).
I use Twig and token in custom blocks (/admin/content/block), It get the path is /io/block by token [current-page:url:path]
and twig {{ path('<current>') }}
, It treats /io/block as the current page.
msn5158 → created an issue.
Also, using io ajax in blocks of ctools → and fieldblock → , they cannot load the block content.
msn5158 → created an issue.
There is a prompt, If tick display empty links, do not use tokens.
If ticked it, when there is no item to replace by token, the token also not removed.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
I couldn't find any relevant tutorials here (https://git.drupalcode.org/project/twig_tweak/-/blob/3.x/docs/cheat-shee...), I don't know that can write the code like this.
Thank you very much, it's working ok.
I couldn't find the field about time in the Manage display, I don't know how to enable it.
Thank you, As you said, it has obtained the creation time of the node by twig_tweak.
{{ drupal_field('created', 'node', 1) }}
But why can't it obtain the change time?
{{ drupal_field('changed', 'node', 1) }}
It doesn't print anything.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
I tested that it does not support data exceeding 20000 rows.
msn5158 → created an issue.
Hello,
The reason for this issue is due to the addition of this rule in the pseudo static:
location ~* \.(css|js)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
If delete it, the page will display normally, but adding this rule can improve the page loading speed. But, this issue does not occur in version 1.8, In version 1.8, regardless of whether this rule is added or not, it can still be displayed normally.
Can it solve?
I now understand how to extract data from a page into current page, but there are still many questions that I don't understand, such as creating a block view or a non page view without a separate URL. How can I use HTMX to load the result set of the view onto a page?Can it do? not from URL page.
{{ attach_library('htmx/drupal') }}
//<button hx-get="/htmx/node/1/teaser"
<button hx-get="/htmx/views/content_recent/block_1" // I know it's wrong, I'm just using it to illustrate the issue.
hx-target="#drupal-off-canvas-wrapper"
hx-select="#page-wrapper"
hx-swap="outerHTML ignoreTitle:true" class="button">
Add
</button>
<div id="drupal-off-canvas-wrapper" >11</div>
I know now, it is the wrong by hx-select, it uses the selector from the page of hx-get.
Also, can it obtain data from different domains?
{{ attach_library('htmx/drupal') }}
<button hx-get="https://abc.website.com/node/1"
hx-target="#drupal-off-canvas-wrapper"
hx-select="#page-wrapper"
hx-swap="outerHTML ignoreTitle:true" class="button">
Add
</button>
<div id="drupal-off-canvas-wrapper" >11</div>
I tested it doesn't work.
msn5158 → created an issue.
Yes, there are many modules that can add ID attributes, such as block_class, but they all have duplicate features and their own differences. For example, block_class cannot change the tag, while fences cannot add ID attributes. However, if they are all installed, they have many duplicate features. I think only one of them is needed, so I hope fences can add the ID feature.
msn5158 → created an issue.
msn5158 → created an issue.
msn5158 → created an issue.
Its inclusion in future plans is good news.
My idea is to display it at the foot of the page to show the total PV of visits to the website. It will accumulate daily visits, and over time, it will become a huge number. When people see the huge number of real traffic, how will they feel, I feel they will have a deep impression for the site.
msn5158 → created an issue.
msn5158 → created an issue.
There is a feature request, hope it has a total PV record, Each page visit will be count one time to display a total PV.
I have found the reason now, it is due to the block_ajax module causing the issue.