Categories
CMS Development Drupal

Displaying translated nodes in views

I am facing a challenge in displaying views for translated contents. Consider a general scenario: Multilingual site with English(site default), German languages. A content type Article has 100 nodes in English language. 50 are translated to German. Default working: If a page is in English language, views results are displayed in English.(100 nodes are displayed). […]

Categories
CMS Development Drupal

How to get a second private files directory?

is it possible to create a second private files directory in addition to the existing private files directory? For a better file structure diversity I would like to set a different second location. As an “ultima ratio” I know, that I can create sub folders in the existing private files directory. Any idea/hints or even […]

Categories
CMS Development Drupal

CKEditor is grayed out after updating to Drupal 8.7.10

CKEditor was working fine on my website. But, after updating the core to the minor version of Drupal 8.7.10, the CKEditor was grayed out. I had updated some of the modules as well. I checked for the permissions and other text formats. The editor is completely grayed out even I couldn’t edit the node pages. […]

Categories
CMS Development Drupal Plugins

How do I use hook_preprocess_page_title()?

I’ve just discovered that Drupal 8 Bootstrap theme doesn’t implement all existent hooks. So, for example, hook_theme_suggestions_page_alter() works, but hook_theme_suggestions_node_alter() doesn’t work. I’m interested on hook_preprocess_page_title(&$variables) and I wonder if it’s possible to incorporate this hook into my custom Bootstrap sub-theme. I have created the page-title.html.twig template and cleared the cache. I saw https://drupal-bootstrap.org/api/bootstrap/docs!plugins!Preprocess.md/group/plugins_preprocess/8.x-3.x but […]

Categories
CMS CSS Development Drupal

Different CSS file when in development mode

Using Gulp I create two css files. One style.css and one style.min.css. Is it possible to load the style.css when developing (locally) and the style.min.css when in production (remote)?

Categories
CMS Development Drupal

Cannot update modules, get a 403 error, drupal 8

An AJAX HTTP error occurred. HTTP Result Code: 403 Debugging information follows. Path: /core/authorize.php/core/authorize.php?batch=1&id=31&op=do_nojs&op=do StatusText: Forbidden ResponseText: 403 Forbidden 403 Forbidden nginx/1.14.2 I’m using Lando and Docker to run this site locally. Error page says : Notice: Undefined index: log in update_authorize_update_batch_finished() (line 210 of core/modules/update/update.authorize.inc). update_authorize_update_batch_finished(, Array, Array, Object) (Line: 454) _batch_finished() (Line: 98) […]

Categories
CMS Development Drupal

Installing earlier version with composer

My server is using PHP version 5, therefore, I need to install Drupal 8 version 8.6.18. But when I try, composer create-project drupal-composer/drupal-project:8.x-dev my_site_name_dir –no-interaction –no-install, I get the following error. [InvalidArgumentException] Could not find package drupal-composer/drupal-project with version 8.x-dev in a version installable using your PHP version 5.6.40. Is there anyway to install 8.6.18 […]

Categories
AJAX CMS Development Drupal

webform ajax callback response not updating text, is something missing?

The code below works inside hook_form_alter. The description and price update from database as desired when in form_alter. I moved the code to the callback and now it wont return/update the values. I use a button to call the ajax callback. The throbber shows and then no change. $form[‘elements’][‘billing’][‘desc01’][‘#prefix’] = ‘<div id=”ajax-desc01″>’; $form[‘elements’][‘billing’][‘desc01’][‘#suffix’] = ‘</div>’; […]

Categories
CMS Development Drupal HTML jQuery

How to load html using jquery in drupal 8?

In my controller, I create function call displaypage() which return below param return [ ‘#theme’ => ‘page_test’, ‘#attached’ => [ ‘drupalSettings’ => [ ‘test’ => [ ‘json_url’ => $jsonUrl, ], ], ], ]; In js file, I’m able to fetch data from json_url like below $.getJSON(drupalSettings.test.json_url, {_: new Date().getTime()}, function(data) { //here on the base […]

Categories
CMS Development Drupal

Why does my Views PDF Display output display differently in different software?

Using Drupal 7 and Views PDF module, I have created an output pdf that looks perfect when opened in a browser, but is inconsistent everywhere else. This pdf displays as follows: Chrome, Firefox, Edge – displays exactly as designed. Acrobat Reader – shows only 1 table background color, rest is blank, no text. Ipad, Outlook […]