Why does my page automatically go up each time the logo is refreshed ?

I have a site on Drupal 8 and I update a block view with the following code :

(function ($, Drupal) {
 
'use strict';
 
setInterval(function() {
$('.region-navigation-logo .view-display-id-block_3').trigger('RefreshView');
}, 10000);
 
})(jQuery, Drupal);

This code updates the logo of the site. The problem is that if I scroll the page down, it goes up a little automatically every 10 seconds.

You can test on my site with :

displaying a block via template

let's say I create a custom block "testtest"

what should I do to include this block via a theme template file, for example on "page--front.html.twig" ?

=> I don't want to use twig tweak for this.

I would like to learn to include the block via code.

Printing the field values of node

Hi,

I am trying to print the contents of the body in the node. These are the following lines of code:

function training_module_node_insert(NodeInterface $node){
     if($node->getType() == 'text') {

        $var = $node->body->value;
        print_r($var);
       
}
}

 But nothing is getting printed. Please let me know how can I print the content of the body?

Thanks,

Minnesota Department of Agriculture

picture of MDA website built by Nighthawk Marketing

Case Study: Minnesota Department of Agriculture

Enhancing Minnesotans' quality of life by ensuring integrity of the food supply, health of the environment & strength of agriculture.

The Minnesota Department of Agriculture’s (MDA) website is a portal to communicate important information to farmers, agricultural businesses, the general public, and employees. Internal and external feedback received from customers and stakeholders provided the business justification to support a complete redesign of the existing MDA website.

Sectors: 
Agriculture
Education
Government

Fine tuning permissions?

When I edit role permissions on my forum (ACL, Chain Menu Access, forum_access installed), each role has an option like view posts, edit posts delete posts.

In a site I made years ago, I had a setup where the permissions were much more finely tuned: eg edit/delete own post, edit/delete any post.

How can this be set up?

How to upload files to content pages?

I was looking to upload document files to a forum thread, but it only offers the choice of uploading an image file, or linking.

What settings need adjusting to allow this, or does it need a module?

I had this option on a forum years ago, but can’t remember how it was done.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x