History of nodes viewed by a user

History of nodes viewed by a user

I’m developing a site using Drupal 8.2 and I have to create a page where the user can see which nodes he or she has viewed in the last 30 days. The goal is to provide a per user "browsing history" view with the recently read content ordered by date... read more
History of nodes viewed by a user

template.php hook to add variable to view

I’m trying to include the total count of a given node type into a view tpl.php file. I would like to set this variable in the template.php file, so that it is available in the tpl.php file (that way I also don’t have sql queries gumming up my template... read more
History of nodes viewed by a user

How to load a node by a field value?

I want to load a certain node. I don’t know the id of the node but I do know that it has a certain hash field that is unique and I know that hash. I want to load the node via the hash field. How can I do that? read more
History of nodes viewed by a user

$base_url variable in settings.php is not being read. How do i set this variable?

On my laptop I recently moved my Drupal sites from Acquia Dev Desktop server to a standard MAMP setup. Problem is the root dir folder isn’t being read. The root dir folder name would be, by default part of the base url. For example, the mission page URL should... read more
History of nodes viewed by a user

How do I get the raw field value in a twig template?

myfield is a plain text field. {{ content.field_myfield }} renders the field with HTML markup and the field label. How do I render the raw value of the field? {{ content.field_myfield.value }} doesn’t work. read more
History of nodes viewed by a user

Configuration changes that will not import?

I have some configuration that will not import. If I run drush config-import –preview I see the changes to be imported; I hit ‘y’ to import. When I run the same command, the changes are still there? My guess is that when I run this command the config... read more
History of nodes viewed by a user

Scheduler Module crontab job does not publish content

When running the Scheduler lightweight cron through crontab, I am getting a message that the lightweight cron has activated and completed in my D8 log, but content is not publishing. When running the lightweight cron through backoffice, items publish correctly.... read more
History of nodes viewed by a user

hook_commerce_order_presave firing on page load

I’m trying to run some code whenever an order is updated. I’ve found the function hook_commerce_order_presave which fulfils this purpose, but it seems this also fires on page load. Is this normal, or is there another module that would be causing this? Is... read more
History of nodes viewed by a user

Is there any way to force a custom block in the Custom Block Library to invalidate cache on edit update?

I have created custom blocks in the Custom Block Library and placed instances of the blocks on a page in Block Layout. The blocks get cached for anonymous users. Editing the custom block and saving does not invalidate the cache for those instances of the blocks.... read more
Reorder Content Types in ("/node/add")?

Reorder Content Types in ("/node/add")?

In drupal 7 it can be do like this. 7 – Reorder Content Types in (“/node/add”) – Drupal Answers How can I reorder Content Types with Drupal 8? read more
History of nodes viewed by a user

How to get vocabularies for an entity reference to a taxonomy?

So I’m having a bit of a difficult time finding out how to get the information I want. I have an entity reference field – call it field_event_type. This is an entity reference to a taxonomy. I am trying to programmatically get the possible vocabularies... read more
History of nodes viewed by a user

How to incorporate AMP in an existing theme?

Is there a way to incorporate AMP into my Porto Theme? read more
History of nodes viewed by a user

Using ‘return’ with an ajax callback renders an entire page before my content is loaded

I’m developing a module that uses Openlayers maps and Drupal Commerce. When you click on the map, you should see products that relate to those coordinates of where you click. I have this working perfectly. I’ve got a ‘foreach’ inside of my... read more
"Allow multiple selection" not available in exposed filters

"Allow multiple selection" not available in exposed filters

I’m having trouble making some options appear as checkboxes in an exposed view form. The problem is that the “Allow multiple selection” option is not available in the filter. How can i make it visible. “Allow multiple selection”... read more
History of nodes viewed by a user

Memory size exhausted when trying to run cron manually

On my Drupal 6 website, when I run manually cron, I get this error message. Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4181580 bytes) in /dirname/includes/database.mysql-common.inc on line 34 Cron is set to automatically run every... read more
Prepend drag icon to each form element

Prepend drag icon to each form element

I am building a configuration form with a few sortable elements. I know, you can build a table using builtin Drupal draggable functionality (drupal_attach_tabledrag), but it’s a bit too complicated for my task. I am saving new order of elements inside a hidden... read more
History of nodes viewed by a user

Overwrite twig (template) files from a contrib module in my custom subtheme?

I need to overwrite and adjust the twig (template) files from the Facet module in my custom subtheme? Is that possible? I need to change below markup and CSS classes (to debug faster, I also added my template suggestion here): <!– THEME DEBUG –>... read more
History of nodes viewed by a user

How do I access a custom variable in block.tpl.php?

I created a custom module that defines a block. In hook_block_view(), I have the following code. $block[‘content’] = theme(‘item_list’, array( ‘count’ => $count)); How can I get the value of $count in block.tpl.php? read more
History of nodes viewed by a user

Not able to access "Updates" page logged in as admin user

I am running a site on Acquia’s dev cloud, using Acquia’s Dev Desktop and sometime in the last few months something has changed to prevent access to the Update tab inside admin/modules/update. I’m logged in as the drupal admin, but when i try to... read more
History of nodes viewed by a user

Drush path settings

I’m fairly new to terminal and very new to Drush – I’ve installed Drush on my VPS using Composer and when I ssh as root all works fine. However I realise I shouldn’t be using root so am trying to set up using another user but keep getting: env:... read more