All Questions

0
votes
0answers
2 views

Force div wrapped to the next row by flex-wrap to be the same width as non-wrapped divs

I'm using flexbox to display a row of divs based on a view. As the width of the window narrows, I want the divs to shrink and then to wrap. I'm using the following (simplified) css: .container { ...
0
votes
2answers
862 views

How to incorporate AMP in an existing theme?

Is there a way to incorporate AMP into my Porto Theme?
0
votes
0answers
6 views

Have alias URL remain alias instead of resolving to target URL

I have a Drupal site with an Event content type. This content type has an Event Categories taxonomy field on it, which, as you can guess, categorizes events. When you navigate to the URL of a ...
0
votes
0answers
4 views

How to include book traversal links on a custom twig template page

I use the Book module to create books with chapters. When I use the default twig template node.html.twig to display a book chapter, a section titled "Book traversal links" is included, with links to ...
1
vote
1answer
12 views

Which hook to use for updates of all nodes of a particular type

This question is about Drupal 7. For a particular node type, let's take three examples: a) book b) article c) customcontenttype I would like to be able to capture the moment of an update of an ...
1
vote
4answers
2k views

Display field inputs side-by-side in node edit form

I have quite a few Field Collections on my node edit form that each have three text input boxes. By default drupal displays them one on top of the other which makes for a very long page: Ideally I'd ...
0
votes
3answers
34 views

Using MYTHEME_page_attachment_alter does not alter the favicon

Based on other similar stackexchange questions and documentation, I've implemented the following in the MYTHEME_page_attachment_alter function in MYTHEME.theme file to change the favicon based on the ...
0
votes
1answer
81 views

Programmatically auto-submit a Webform after visiting its URL

I am wondering whether it's possible to programmatically auto-submit a Webform after visiting its URL and to save the user from a 'submit' button click. The below webform can be accessed via /form/my-...
1
vote
2answers
399 views

How do I display a block on the checkout page based on the product type?

I have created some custom blocks in code that are shown on the Drupal Commerce checkout page. I would like the block to have differ content basing on which items are in the cart. How can I achieve ...
15
votes
5answers
17k views

Changing url of exposed filter

When I used an exposed filter the filter selection is passed as name/value pair in the url, for example: members?field_a=valuea&field_b=valueb How can I set it up to use more of a "pathauto" ...
0
votes
1answer
15 views

amp-img tag, replace to simple img

I need to change this tag <img> to <amp-img>, I've been researching about this and I have this function for change the img tag. function amptheme_image($variables) { // Remove RDF ...
0
votes
2answers
2k views

Entity Reference Selection by View

I have two content types, Location and Offer. The Offer type has an entity reference field that points to one or more Locations. A user of my Merchant role may create Location and Offer nodes. When ...
1
vote
0answers
13 views

How to render all paragraphs of a node as slider instead among themselves?

Initial situation I have a node type with a paragraph field. Each paragraph of the paragraph field is rendered among themselves. What I want to achieve The paragraph field inside the node should ...
0
votes
0answers
14 views

Return an Ajax Response from EventSubscriber?

I am trying to return an ajax response when a user logs in while the page is loading post-login. /#1 approach was attaching an ajax callback to the user login form submit with form_alter. However ...
2
votes
2answers
2k views

How can I give a list_string BaseFieldDefinition in a content entity a default starting value?

I have an entity with a list_string field in my content entity that outputs to the entity form as a list of checkboxes. IE: $fields['colors'] = BaseFieldDefinition::create("list_string") ->...
1
vote
1answer
1k views

How do I display, in a ColorBox popup, a caption AND a title (caption from image 'alt' attribute and title from 'title' attribute

I am trying to display in a ColorBox popup, a caption AND a title (caption from image 'alt' attribute and title from image 'title' attribute). The colorbox is opened when an image is clicked. Here ...
0
votes
0answers
17 views

Flag/Unflag Taxonomy term when updating Taxonomy field in user profile

I asked this question a few days ago: Send email to all users that are tagged with the same tag a node is when created I decided to go a different route and use the flag and rules module to associate ...
0
votes
1answer
19 views

How do I convert "entity:node/9 in a link?

I need to get some values from a custom block I've created, and I am using the following code. // Get the block $block = \Drupal\block\Entity\Block::load('hightlight'); // Get the block content $...
0
votes
1answer
23 views

How to setCookie in samlredirect function

I am trying to logout users when they hit a particular path in the website and log them back in to renew the session(because it has its own login session and its expiry is not in sync with the actual ...
2
votes
1answer
31 views

Is it compatible with PHP 7.2?

We have a Drupal 7 site running Drupal Commerce. Our host has now informed us that they will be updating PHP from 5.6.3 to PHP 7.2. Is Drupal Commerce for Drupal 7 compatible with PHP 7.2? I have ...
1
vote
1answer
6 views

Display articles based on group combinations of various group types

I took a look at the group module. Defining permissions based on user and entity memberships would suit my needs very well, but sometimes I would need a combination of various group memberships to ...
1
vote
1answer
902 views

Why I cannot get translated entities

I wrote service to get all necessary data for my page. Now I wanted to load them with translations. But whey I try, I got error: InvalidArgumentException: Invalid translation language (id of ...
0
votes
3answers
2k views

User error: “1” is an invalid render array key in Drupal\Core\Render\Element::children()

I want to print "your_variable" (array) in my twig template, but i have errors. I have .theme in my theme : function MYTHEME_preprocess_views_view_fields(&$vars) { $tempstore = \Drupal::...
0
votes
1answer
34 views

Editing contents of custom block referenced in paragraph type, doesn't reflect changes in node where displayed

So, I have a Custom Block type, let's call it Sidebar Links Block. In an Article, we have a Sidebar paragraph type that allows quite a few different entities, one of which is the Article Sidebar Links ...
1
vote
2answers
1k views

How do I integrate a custom header and footer?

I need to add a custom header to a theme that I am currently building. The only way I can seem to get the header and footer to show up on the page is to hard code it into the page.tpl.php file. I've ...
2
votes
1answer
808 views

Unable to set file upload destination private when programmatically creating new content type with file field

I am creating a module to upload video to an in house media converter - as part of the module installation I create a new content type called "user video" which has a file field as part of it. I need ...
2
votes
4answers
1k views

Why isn't this module library loaded?

I am using the following code. wk_elastic.info.yml name: Blablabla description: Blablabla package: BlaBlaBla type: module core: 8.x libraries: - wk_elastic/list-js dependencies: - block ...
0
votes
2answers
26 views

Change html tag in template file tpl

I have this template file for a view: views-view--ir-news--page.tpl.php But right now, I need to use Google AMP only for this view (Machine name: ir_news) What I want to know is if something like ...
0
votes
0answers
21 views

A field only visible when a node is being edited

I have a custom field which should be only visible when a node (an article) is being edited (and not shown when a new content is created). I'd like to avoid installing a module for this, so my ...
0
votes
0answers
18 views

Add an anchor to the redirect URL

I have a website with some news. I create a view that shows them and filter by category. When I use the filter, it reloads the page and goes at the top of the page. I want it doesn't move on the top ...
3
votes
1answer
1k views

Permission rebuild fail

My Drupal 7 site is upgraded from Drupal 6. When I install the Domain Access (not installed with Drupal 6) module, I need to rebuild permissions. I tried rebuilding them from the administrative pages,...
0
votes
0answers
10 views

How to order datetime items chronologicaly on save

Is there a module or a simple way to order a multipe datetime/datetime_range field chronologicaly on every save? I want to be sure that the last item is always the last one.
1
vote
1answer
21 views

Why is Twig not outputting this correctly?

I have function hook_theme_preprocess(array &$variables, $hook) { $variables['bla'] = ' AA <strong> BB </strong> CC '; } In my template I have: {{ bla }} The problem is, in ...
41
votes
15answers
59k views

Getting the image URL from a field_image on a node

So I have this Node: object(Drupal\node\Entity\Node)[1862] protected 'values' => array (size=17) 'vid' => array (size=1) 'x-default' => string '7' (length=1) ...
0
votes
1answer
13 views

How can I use a content type field on the body of the e-mail message template on the Webform module?

For usability matters, I would like to let the editor create his own confirmation message on my Event content type. So I create a field for that. I also have another field to select which webform is ...
2
votes
2answers
922 views

Trigger jQuery “add more” multiple times

I have a form that I am filling with default values in hook_form_alter. Some of the fields are in a in a field group and I need to trigger the "add more" button using code. I figured out how to send ...
6
votes
4answers
8k views

How do I set up CORS?

Drupal 8 has RESTful web service in-built in core and since 8.2 we don't need cors module. Now to use services we just enable and configure default.service.yml file as specified in here However, I ...
0
votes
0answers
17 views

Change git repository in Drupal install [on hold]

I have started to work on a new project and was provided with bitbucket git repository, when I looked on staging server I noticed that the old developer was working on a gitlab repo. I have spoken to ...
0
votes
1answer
12 views

Contextually filtering a view using values from a completely separate table?

I have a table "user_connections" id | uid1 | uid2 1 | 1 | 2 2 | 3 | 1 etc So, if the current user has uid = 1, then according to my table, he is "connected" to use 2 and 3. So I just want ...
0
votes
0answers
18 views

Validation after all other validations were successful

I have a form with several form fields and two validation handlers. function my_module_my_form_validate_integer($element, &$form_state) { // validation stuff } function ...
0
votes
1answer
913 views

How to send an email once every 6 months using the Rules module?

How to send an email once in every 6 months at 12:00 am for a date field about user renewal which is there in user profile using the Rules module? Its mail should send in cyclic form every once in 6 ...
13
votes
5answers
17k views

How to get each field value in views-views-unformatted--view-machine-name.html.twig?

I have an twig file: views-view-unformatted--view-machine-name.html.twig {# /** * @file * Default theme implementation to display a view of unformatted rows. * * Available variables: * - title: ...
0
votes
1answer
32 views

Failed User Login

I have developed a website in Drupal 8 and have deployed it to production. I have created 7-8 other accounts for my content management team and have granted them limited privileges for creating, ...
0
votes
1answer
2k views

How add fields programmatically to a custom entity bundle?

i create a custom Entity, CustomEntity.php public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields = parent::baseFieldDefinitions($entity_type); $fields['...
-3
votes
0answers
12 views

How can we alter drupal primary links?

I want to add and remove some links at runtime. How can I do this in Drupal 6? I want to display them on a conditional basis.
1
vote
2answers
568 views

What is the correct way to get the link url?

We have a Basic Page content type with a link field (field_link). When we call the mymodule_preprocess_node(&$variables) hook in a custom module we use ksm($node->get('field_link')->first()) ...
1
vote
1answer
21 views

How to add a condition for an array on an entity query for a config entity?

I want to execute an entity query on a config entity type. However when I want to add an IN condition on a property which is an array I am getting an error. For example, I want to retrieve all user ...
4
votes
7answers
3k views

Image styles do not work

I am struggling to find a solution for image styles not getting generated. The original pictures get uploaded to the server but no styles or thumbnails are generated. I have checked folder ...
5
votes
2answers
1k views

How can I manually send order details email to customer in Ubercart?

I have a cron job to read orders from the Ubercart database table, and manually send the order email to the customer. Usually, when customers checkout in Ubercart, they will get their order email ...
3
votes
1answer
2k views

Date field exposed filter - select year

Back in Drupal 7 I've created exposed filter with Year from date field. (Selet list). View all 2017 2016 2015 etc... And when creating such filter we had options like on this picture: BUT, now in ...

15 30 50 per page