$variables is cached...

In relation to this, now resolved, issue (thanks again Jeff!):

https://www.drupal.org/node/2679086

Ok, so in MY_THEME.theme I have:

function MY_THEME_preprocess_menu(&$variables) {
  $variables['MY_THEME_path'] = \Drupal::request()->getPathInfo();
}

so that in my menus I can see what page I'm on and style the links accordingly.

d8: Import Content

I posed this question in the 'Converting to Drupal' sub-forum, but seems like the threads there are mostly targeted by spambots:
https://www.drupal.org/node/2678378

Let me cut to the chase: how do I import prepared content into Drupal 8?

I'd like to convert a games related website to Drupal. Being able to create a Games content type, and then relating Articles back to one or more Games would save me so much time!

change Breadcrumbs from Node Title to Menu Link Title

(Edit: I realised original title adapt PathBasedBreadcrumbBuilder to use Menu Link Title is less of a general & attractive idea than the simpler statement above.)

I am trying to adapt PathBasedBreadcrumbBuilder.php so it displays the Menu Link Title of each breadcrumb ancestor rather its node title. The node titles can get really long on our site, so they make poor breadcrumbs in our hierarchy of nested nodes with much shorter menu titles.

Get last accessed timestamp value of a user in Drupal 8

Im trying to display the last accessed field when a user logs in. For this I tried using User::getLastLoginTime() . But this returns a fatal error saying

PHP Fatal error: Call to undefined method Drupal\customize_block\Plugin\Block\ContractDetails::get() in /var/www/html/core/modules/user/src/Entity/User.php on line 265

Here is my block ,in my custom module:

Drupal 8 article problems

So we're using Drupal on a little project we got going, and basicly all a user should be able to do, is login once logged in he should be able to create a new article and only the creator and admin are able to see these articles, other users with normal rights shouldn't be able to see anyones else articles.

We got a article system but the problem is with limiting it to admins/the creator, all users who are logged in are able to view these articles.

Ecommerce module

Hi friends,

I have installed the e-commerce module and everything is ok, but when I try to create a product from the tab Commerce>Products-> Add product, I have this error :

Fatal error: Call to a member function buildForm() on null in /home/xxxxx/xxxxx/core/lib/Drupal/Core/Entity/ContentEntityForm.php on line 59

All necessary modules for DrupalCommerce are installed and enabled !

An idea ?

Thanks all.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x