All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
673 views

Theme reply comments differently from node comments (Drupal 7)

I am using Drupal 7. I have a question/answer website, I want to theme reply comments differently from node comments. How can I apply a different css theme to differentiate node comments from comment ...
0
votes
0answers
37 views

Why does a node appear in two slides?

I'm working on a Drupal 7 site with the Nodequeue module installed. I have a content type named Real Estate Listing, and I need to display a nodequeue for this content type inside the royalslider ...
0
votes
2answers
2k views

Display block on certain page

I want to display a block on the user/* page. I checked "only the listed pages" and entered "user/" but the block also appears on "user//relationships" for example. How can I keep the block on just ...
0
votes
1answer
197 views

How to pass along current $form_state for an #upload_validators callback?

I have a managed_file #upload_validators callback and when it is called the $form_state does not get passed along with it. My goal is to use another field in the form to rename the uploaded file. I ...
0
votes
1answer
100 views

Student TV channel - taxonomising YouTube videos

This question has been created to break up a previous question; see there for more detail. As you can guess from the title, I'm the new webmaster for a student TV channel and I need to update the ...
0
votes
1answer
42 views

How to add placeholders in customized module? [duplicate]

I am new to drupal, currently I am creating a new module for forms. Inside of module I have added the code as follows . $form['first name'] = array( '#type' => 'textfield', '#title' => ...
0
votes
0answers
46 views

Printing views table [duplicate]

Possible Duplicate: How do I print a view table? I'm using drupal 7. I have already asked for printing views tables but no one answered me. I used print module but does not support printing views....
0
votes
1answer
480 views

Block in Drupal 8

I have coded a plugin in my module which extends block base and generates labels for block in /admin/structure/block page under Place block. These block are being generated for different entities. The ...
0
votes
2answers
4k views

File upload error “Files must be less than x MB” despite file being smaller than x

I have a file field called Video for a content type called Tutorial Video. My settings are thus: Allowed file extensions: txt, mp4 Maximum upload size: [empty] The maximum upload ...
0
votes
1answer
3k views

Pathauto url of term for node?

With Pathauto, is it possible to use the url of a node's term as a token? In case it makes a difference im using the Taxonomy Menu module aswell. Thanks UPDATE - The taxonomy is hierarchical. So ...
0
votes
2answers
37 views

more fields on a content type or more content types

I know this is a situational/subjective question..... but I am trying to figure out a site architecture for a drupal site. I have multiple products with different attributes/properties. I could ...
0
votes
2answers
44 views

How to define multiple blocks in a module?

Thanks to this tutorial, I cam up with this block-generating module: function myblockmodule_block_info(){ $block['myadblocks'] = array( 'info' => t('My first ad blcoks'), '...
0
votes
0answers
37 views

How do I add multiple custom CSS classes to Views references field?

As a follow up to this question I need to resolve the same issue for References module, in concrete the views integration. When defining References Views display, no CSS classes can be added to rows (...
0
votes
1answer
693 views

How to modify module output via another module - whois module?

In drupal 7, can we access and read return value of a specific module via another module? Specifically, I am using the whois module, and would like to access its output from a custom module, with the ...
0
votes
2answers
73 views

Upload a drupal site to the server to test [closed]

I have finished the drupal website on my localhost. I want to upload everything to the server, but only to test before officially launching it. Is there a way that I can keep my current non-drupal ...
0
votes
0answers
25 views

Entity Reference View fails after update to drupal 8.7.6

Recently I updated my drupal site from 8.6.14 to 8.7.6. A previously-working Entity Reference View display that is connected to a form Autocomplete field stopped working. The spinning circle keeps ...
0
votes
2answers
778 views

How to check logged in user username/password/role using Drupal function for validation [duplicate]

I am allowing user to register in my site. while registering, user is assigned with a specific role using user_save while logging in as registered user, I have to check if login credential are ...
0
votes
1answer
110 views

View scanning wrong template file [closed]

I've inherited a Drupal 7 site that's having an issue. The field "date" appears on the test site, but not on prod, and the field "title" is linked on test, but not prod. On both sites, the "date" ...
0
votes
1answer
57 views

How to wrap a whole view in a tpl file?

I created a view and I'd like to wrap it with a link in a template file. I've never worked with custom template files for views, so I've no idea where to start. How can I do this?
0
votes
1answer
1k views

How to get node editing form in a custom module

how to call a drupal node editing form in a custom module? What i have done so far: /* * implementing hook_menu() */ function mymodule_menu() { $items = array(); $items['custompage'] = array(...
0
votes
1answer
409 views

Content types & ubercart

I have another question about ubercart. I have a content Type hotel & a content type tript (city trips etc) that people can buy, (just one price). I really don't know if it is possible to add my ...
0
votes
2answers
210 views

Change node content after logging in under the same URL alias (showing other content for authenticated users)

I would like to change node content under some specific URL aliases after the user logs in, to show some other contents for authenticated users. With a really simple example, there's a node which can ...
0
votes
2answers
1k views

Inserting custom HTML using tokens

I'm trying to reduce repetitive coding by adding my own static HTML content into some form of reusable token that can be added into page bodies amongst regular code, but can't find a method. Here's ...
0
votes
1answer
730 views

How to create and add a page to a book programmatically?

I have studied create nodes programmatically and create a book page but still i did not find how to create and add a page to the existing book. How to set parent child relationship if applicable. I am ...
0
votes
1answer
2k views

Adding sub menu to Management menu

I'm trying to add a sub-menu under administration, for example: Management: ...... Content Structure ...... My test (sub menu under administration) My view 1 (a view that I ...
0
votes
2answers
2k views

Add value to field using hook_webform_submission_presave() [duplicate]

I am at my wits end trying to use the hook_webform_submission_presave function on a webform that I have created for a Drupal 7 site. Ideally I would like to capture a list of nodes that a user has ...
0
votes
0answers
147 views

How to serialize a form's render array to JSON

I want to build a REST resource to return Forms as JSON with all labels, help text, default values, etc... When I use REST's built-in resource /entity/entity_form_display/node.article.default it does ...
0
votes
1answer
675 views

Conditionally assign a custom role on user registration

I've written a custom module that uses hook_form_alter() to set some default values from GET-parameters when the user registration form is called with certain GET values. That is, if you call mysite....
0
votes
3answers
602 views

webform select options validation unique

I need to prevent two different users from choosing the same option from a webform select options component. In the validation only validation required available, no unique validation. For example: ...
0
votes
1answer
522 views

How do I add image captions using a custom style?

I am not a programmer. However, I need to know how to use css to add a caption for an image field in a node.
0
votes
1answer
562 views

How to attach node into panelized node?

I've got content type which panelized using Full page override. So I would like to attach an existing node into newly created node and assign it into the region as normally you would do this at /node/%...
0
votes
3answers
1k views

How to redirect from URL with trailing slash to one without

We are using the Redirect module 8.x-1.2 with Drupal 8.5.6. When generating URLs, we are finding that a trailing slash is added to the end of the URL, and this is creating a 503 error code. How ...
0
votes
1answer
3k views

Warning: Cannot use a scalar value as an array

function theme_test($form) { $output = ''; foreach($form['field'] as $key => $val){ $output .= '<div class="test">'; $output .= drupal_render($val['uid'. $key]); $output .= ...
0
votes
1answer
787 views

Changing '#view_mode' in content type's render array

I have a content type in Drupal 8 project that has image, name, info and body field as a default display, and image,name and information as a teaser display. I am able to display this content type ...
0
votes
2answers
407 views

Does caching has to be manually disabled for ajaxified forms?

I switched on caching on my dev environment and it looks like ajaxified forms won't work* unless I specifically set max-age to them to 0. Is this normal? Or is this the case only when a form is ...
-1
votes
2answers
2k views

Adding font-size and color buttons

Is there a way to unlock it or should I install a total different editor (while trying to convince some in the community to bring these options back)? I will prefer a modular way. I work with Drupal ...
-1
votes
1answer
288 views

How to get views header and footer in view block template

I have created view as block and in block twig template i can print view fields as content['#view'].field['field_machine_name'].value(row) HOw can i print text in textarea that i set as header and ...
-1
votes
2answers
38 views

How to create one more registation page in drupal site

In our drupal site we have a Registration page. and the new requirement is creating the one more registration page with same functionality(newly created registration page also use same database to ...
-1
votes
1answer
61 views

Captcha image is not detected but installed and working properly

I have installed Captcha and Image Captcha submodule (included in Captcha). It works perfectly, and displays the captcha image. However, when trying to install Captcha Refresh module, I found that ...
-1
votes
1answer
31 views

How to add fields while creating a node? [closed]

I am looking for a module which allows a user to create a new field while adding a new node. Is this possible, or should I resort to comma separated values in a big text area?
-1
votes
3answers
430 views

How to replace drupal-render-placeholder manually?

I've got the element with following plain string (result of some kind of side effect): <drupal-render-placeholder callback="Drupal\block\BlockViewBuilder::lazyBuilder" arguments="0=myform&...
-1
votes
1answer
285 views

How do I get the login form submitted values in hook_user_login()?

Since hook_user_login() in Drupal 8 has only 1 arg, how can I get the values submitted in the form? In other words, what is the equivalent of $edit['input]['element_name'] I would use in Drupal 7?
-1
votes
1answer
82 views

Composer's drupal/drupal package versus Composer's drupal/core package - deciding which to choose

I never used Composer before the year 2018 in any significant way but as Drupal 8 was developed with a Composer-centralized philosophy, I'm out to start basing all my Drupal projects (which I usually ...
-1
votes
1answer
673 views

Can I create a table with hook_schema that has two timestamp fields?

For my module I want to create a table with an updated_on and created_on field, both of type timestamp. I found this can be done with mysql_type, but you need to specify a default value for that ...
-1
votes
1answer
362 views

Adding composer to update core [duplicate]

I'm using a site created on Pantheon and now I'm not using pantheon. So the core is not installed with composer. Now I want to upgrade core with composer but I don't understand how. I've some ...
-1
votes
1answer
1k views

Service request with OAuth (Invalid signature error)

I'm making a service request(POST) with curl and OAuth signature. I have created a signature with the following code: $signature_method = new OAuthSignatureMethod_HMAC(strtolower('SHA1')); $...
-1
votes
2answers
78 views

Naming a template file

D7, bartik. A comment form is created by an .inc file (modulename.page.inc). This comment form is to comment on existing comments. To create the comment form, the inc page says: function ...
-1
votes
1answer
42 views

Error with Event Subscriber using getRouteName()

I have a problem with event subscriber. Here is the error: The website encountered an unexpected error. Please try again later. Error: Call to a member function getRouteName() on null in Drupal\...
-1
votes
1answer
62 views

sending mail after checking a selected list in field

In my content i have an select list text field.I have an four options far that,while clicking only particular one in select list and giving click save.Then i want to generate mail to administrator. ...
-1
votes
1answer
173 views

How to send mail after selecting text from select list using rules? [closed]

In my content I have a select list text field. I have four options for that. While clicking only particular one in select list and giving click save. Then I want to generate mail to users.For example: ...

15 30 50 per page