Drupal StackExchange

Vertical Tabs in Panel Pages

4 days 15 hours ago

I am trying to have three forms available to the public on my site and would love to have them configured in in the vertical tabs layout. Initially I was going to have them available through node/add/form but I have since decided I would rather have them in a panel page to lose that path of node/add. Now that I have the forms in the panel page they no longer have the vertical tab/fieldset layout. How would I go about putting the forms back in that tabbed layout while staying in a panel page?

user975044

Change the subtotal amount in commerce_email_order_items

4 days 16 hours ago

First, sorry for my poor English, and the faults you will probably found.

Globally, what I am trying to do , is to add the shipping amount into the 'base_price' component price, also labelled subtotal.

So far, it's working correctly on the site itself with the use of the hook hook_commerce_price_formatted_components_alter(). To give you an idea, here is the code that handle it.

function base_price_shipping_commerce_price_formatted_components_alter(&$components, $price, $entity) { // We modify $variables to "merge" base_price and shipping if ( isset($components['base_price']) && !empty($components['base_price']) && isset($components['flat_rate_expedition_internationale']) && !empty($components['flat_rate_expedition_internationale'])) { // We calculate the new price with included expedition $price_with_shipping_amount = $components['base_price']['price']['amount'] + $components['flat_rate_expedition_internationale']['price']['amount']; // We format this price with the used currency $price_with_shipping_formatted = commerce_currency_format($price_with_shipping_amount, $components['base_price']['price']['currency_code']); // We update the display of base_price component with the new price $components['base_price']['price']['amount'] = $price_with_shipping_amount; $components['base_price']['formatted_price'] = $price_with_shipping_formatted; // We unset the display of shipping //unset($components['flat_rate_expedition_internationale']); } }

Now the problem is to do the same thing with the token [commerce-order:commerce-email-order-items]. I know it's generated with commerce_email_order_items() and by commerce_email_prepare_table() specially. But I don't get to understand how to make it work, or where to make the change.

Directly and overide the function commerce_email_prepare_table() ? It will probably be around the ligne 174 in the commerce_email.module file :

$data = $wrapper->commerce_order_total->data->value(); if (!empty($data['components'])) { foreach ($data['components'] as $key => &$component) { if ($data['components'][$key]['name'] == 'base_price') { $rows[] = array( 'data' => array( ' ', array('data' => t('Subtotal:'), 'style' => array('font-weight: bold; text-align: right;')), array('data' => number_format(commerce_currency_amount_to_decimal($data['components'][$key]['price']['amount'], $currency_code), 2), 'style' => array('font-weight: bold; text-align: left;')), ) ); }

Another possibility is to change the amount of the 'base_price' component, not on a formatted level (which just change it before display), but at the "root", for real. I don't know if I am clear enough. But after days of research and try to understood the Price API, I still don't get it, and which hook or function to use : http://www.drupalcontrib.org/api/drupal/contributions%21commerce%21modules%21price%21commerce_price.module/7

Which way do you think is the best ? Thank you for reading. Pierre.

Pierre Noel

How to create third party settings for themes?

4 days 17 hours ago

How to I properly implement third party settings for a theme, without clearing 3rd party settings from other modules?

E.g. my site has a gin.settings.yml with

third_party_settings: shortcut: module_link: true

Now I install my module, which implements hook_form_system_theme_settings_alter :

function tailwind_jit_form_system_theme_settings_alter(&$form, $form_state, $form_id = NULL) { $form['third_party_settings']['tailwind_jit'] = [ '#type' => 'details', '#open' => TRUE, '#title' => t('Tailwind CSS Just-in-time compilation'), '#tree' => TRUE, '#parents' => ['third_party_settings', 'tailwind_jit'], ]; $form['third_party_settings']['tailwind_jit']['compile_html_requests'] = [ '#type' => 'checkbox', '#title' => t('Compile HTML requests'), '#default_value' => theme_get_setting('third_party_settings.tailwind_jit.compile_html_requests', $themeToBeConfigured), ]; }

This works and saves my config settings BUT it also wipes the pre-existing shortcut.module_link setting from shortcut module, leading to a config like

# shortcut settings are now missing third_party_settings: tailwind_jit: compile_html_requests: 1

How to I properly implement 3rd party settings in hook_form_system_theme_settings_alter?

Hudri

Search API Solr Configured, Content Indexed, No Search Results

4 days 17 hours ago

I'm running a Drupal 8.6.13 site with Search API 8.x-1.12 and Search API Solr Search 8.x-2.7. Everything seems to be properly installed and configured - my Solr admin panel shows a configured core and everything looks fine on my Drupal admin interface. I have the index set to process the body fields of my content and custom blocks using the fulltext type; I have 198 items indexed:

{ "response":{"numFound":198,"start":0,"maxScore":1.0,"docs":[] }}

The problem is that a search for a word that definitely appears in my content isn't producing any results. I'm using the config files from the Search API Solr Search module.

Solr Search Devel shows the request being sent to the server and an HTTP "200 OK" response being received. The logged response was:

{ "response":{"numFound":0,"start":0,"maxScore":0.0,"docs":[] }}

What else could I be missing?

Some more detail:

I can retrieve documents from the index using a command line query, like this:

$ curl "http://localhost:8983/solr/mycore/select?indent=on&q=:"

Here's an example of one of the returned documents:

{ "id":"6a1a2p-content-entity:node/100:und", "sm_context_tags":["search_api_X2f_index_X3a_content", "search_api_solr_X2f_site_hash_X3a_6a1a2p", "drupal_X2f_langcode_X3a_und"], "tm_body_1":["Ignition Timing (Vacuum advance disconnected, lines plugged) 6° BTDC Dwell Angle 30-33° Point Gap .020\" Spark Plug Gap .035\" Idle RPM * (Manual Transmission, no A/C) 725 Idle RPM * (Manual Transmission, with A/C) 725/500 ** Idle RPM * (Automatic Transmission, no A/C) 675 Idle RPM * (Automatic Transmission, with A/C) 675/500 ** Firing Order 1-5-4-2-6-3-7-8 * Set idle speed with headlights on high beam, air conditioning off. ** Higher RPM, solenoid energized. Lower RPM, solenoid de-energized. "], "spell":["Ignition Timing (Vacuum advance disconnected, lines plugged) 6° BTDC Dwell Angle 30-33° Point Gap .020\" Spark Plug Gap .035\" Idle RPM * (Manual Transmission, no A/C) 725 Idle RPM * (Manual Transmission, with A/C) 725/500 ** Idle RPM * (Automatic Transmission, no A/C) 675 Idle RPM * (Automatic Transmission, with A/C) 675/500 ** Firing Order 1-5-4-2-6-3-7-8 * Set idle speed with headlights on high beam, air conditioning off. ** Higher RPM, solenoid energized. Lower RPM, solenoid de-energized. "], "site":"http://example.com/", "sort_title":"PRD2\u0005\u000eRH\u0004NH2.:4:.*P:FDN\u0000", "_version_":1630197909793275904, "ss_search_api_datasource":"entity:node", "sort_body_1":":6D:P:FD\u0004P:B:D6\u0004\t<8e>T*.RRB\u0004*0T*D.2\u00040:N.FDD2.P20\u0006\u0004@:D2N\u0004H@R6620\t<90>\u0004\u001f\fS\u0004,P0.\u00040V2@@\u0004*D6@2\u0004\u0019\u0013\u0005\u000e\u0019\u0019\fS\u0004HF:DP\u00046*H\u0004\b\u0013\u0017\u0013\tx\u0004NH*L>\u0004H@R6\u00046*H\u0004\b\u0013\u0019\u001d\tx\u0004:0@\u0000", "index_id":"content", "ss_title":"Tune-Up Specifications", "hash":"6a1a2p", "ss_search_api_id":"entity:node/100:und", "timestamp":"2019-04-07T22:57:56Z", "ss_search_api_language":"und"}

So then I tried a query using a term found in the content above:

$ curl "http://localhost:8983/solr/mycore/select?q=solenoid" { "response":{"numFound":0,"start":0,"docs":[] }} $

Why might the second query fail to produce results if the search term is included in the document as shown in the full list of results?

Scott Hollenbeck

How to add UniqueField constraint on integer field?

4 days 18 hours ago

The title basically says it all. I have the following field definition in an Entity class:

$fields['code'] = BaseFieldDefinition::create('integer') ->setLabel(t('unique code')) ->setDescription(t('Some unique code')) ->addConstraint('UniqueField') ->setTranslatable(false) ->setRequired(true) ->setDisplayOptions('view', array( 'label' => 'above', 'weight' => 4, )) ->setDisplayOptions('form', array( 'weight' => 4, )) ->setDisplayConfigurable('form', true) ->setDisplayConfigurable('view', true);

Creating a new entity in the UI works as expected as long as I do not set the code value to something already in the database. However, as soon as I try to create a new entity with an already existing value for code (thus triggering a constraint violation), I get the following error:

The website encountered an unexpected error. Please try again later. TypeError: Argument 1 passed to Drupal\Core\Form\FormState::setError() must be of the type array, null given, called in /var/www/html/web/core/lib/Drupal/Core/Field/WidgetBase.php on line 454 in Drupal\Core\Form\FormState->setError() (line 1156 of core/lib/Drupal/Core/Form/FormState.php).

If I change the field definition to use a string instead everything works as expected:

$fields['code'] = BaseFieldDefinition::create('string') ->setLabel(t('unique code')) ->setDescription(t('Some unique code')) ->setSetting('max_length', 5) ->addConstraint('UniqueField') ->setTranslatable(false) ->setRequired(true) ->setDisplayOptions('view', array( 'label' => 'above', 'weight' => 4, )) ->setDisplayOptions('form', array( 'weight' => 4, )) ->setDisplayConfigurable('form', true) ->setDisplayConfigurable('view', true);

So the question is how do I add a unique constraint for an integer field? Is there another validation class I can use, am I setting up my integer field definition wrong thus causing the error, or?

Jens Wegar

How to render a link to a page fragment in Twig

4 days 18 hours ago

I have a Twig template that prints a link with the following code:

{{ link(item.title, item.url) }}

This code is rendered as an a element with a href attribute similar with the following:

https://www.mysite.com/alias/to/page

I would like the href attribute to link to a specific element in the destination page, that is to create an a element that contains a href attribute with a contents similar with the following:

https://www.mysite.com/alias/to/page#secondary_title

Thank you.

quilx

Long Ajax error using Date module Views and Fullcalendar

4 days 19 hours ago

I have searched for many posts and i am already doing the suggestions. Nothing is fixing this.

Fullcalendar module says to use the "use ajax" option within views but it throws a huge error.

Notice: Undefined index: date in date_text_element_process() (line 322 of /var/www/html/drupal/sites/all/modules/date/date_api/date_api_elements.inc).

[{"command":"settings","settings":{"basePath":"/","pathPrefix":"","ajaxPageState":{"theme":"seven","theme_token":"M0zPUqa2WJ22nPMH1OUnLDQwPXU0b8nwseud8PJfMbg","jquery_version":"1.7"},"urlIsAjaxTrusted":{"/admin/structure/views/ajax/display/event_calendar/page/use_ajax":true}},"merge":true},{"command":"viewsDismissForm"},{"command":"viewsShowButtons","changed":true},{"command":"viewsTriggerPreview"},{"command":"insert","method":"html","selector":"#views-tab-page","data":"\u003Cdiv id=\u0022edit-display-settings-details\u0022\u003E\u003Cdiv id=\u0022edit-display-settings-top\u0022 class=\u0022views-ui-display-tab-actions views-ui-display-tab-bucket clearfix\u0022\u003E\u003Cdiv class=\u0022ctools-no-js ctools-button ctools-dropbutton\u0022\u003E\u003Cdiv class=\u0022ctools-link\u0022\u003E\u003Ca href=\u0022#\u0022 class=\u0022ctools-twisty ctools-text\u0022\u003Eopen\u003C/a\u003E\u003C/div\u003E\u003Cdiv class=\u0022ctools-content\u0022\u003E\u003Cul class=\u0022horizontal right actions\u0022\u003E\u003Cli class=\u0022duplicate\u0022\u003E\u003Cinput type=\u0022submit\u0022 name=\u0022op\u0022 value=\u0022clone Artist Show Schedule Page\u0022 class=\u0022form-submit\u0022 /\u003E\u003C/li\u003E\u003Cli class=\u0022delete\u0022\u003E\u003Cinput type=\u0022submit\u0022 name=\u0022op\u0022 value=\u0022delete Artist Show Schedule Page\u0022 class=\u0022form-submit\u0022 /\u003E\u003C/li\u003E\u003Cli class=\u0022disable\u0022\u003E\u003Cinput type=\u0022submit\u0022 name=\u0022op\u0022 value=\u0022disable Artist Show Schedule Page\u0022 class=\u0022form-submit\u0022 /\u003E\u003C/li\u003E\u003C/ul\u003E\u003C/div\u003E\u003C/div\u003E\u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting odd clearfix\u0022 \u003E\n \u003Cspan class=\u0022label\u0022\u003EDisplay name:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/display_title\u0022 class=\u0022views-ajax-link \u0022 title=\u0022Artist Show Schedule Page\u0022 id=\u0022views-page-display-title\u0022\u003EArtist Show Schedule Page\u003C/a\u003E \u003C/div\u003E\n\u003C/div\u003E\u003Cdiv id=\u0022edit-display-settings-main\u0022 class=\u0022clearfix views-display-columns\u0022\u003E\u003Cdiv class=\u0022views-display-column first\u0022\u003E\u003Cdiv class=\u0022views-ui-display-tab-bucket title\u0022 \u003E\n \u003Ch3\u003ETitle\u003C/h3\u003E\n \u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting overridden even clearfix\u0022 title=\u0022Overridden\u0022\u003E\n \u003Cspan class=\u0022label\u0022\u003ETitle:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/title\u0022 class=\u0022views-ajax-link \u0022 title=\u0022Change the title that this display will use.\u0022 id=\u0022views-page-title\u0022\u003EShow Schedule\u003C/a\u003E \u003C/div\u003E\n\u003C/div\u003E\n\u003Cdiv class=\u0022views-ui-display-tab-bucket format\u0022 \u003E\n \u003Ch3\u003EFormat\u003C/h3\u003E\n \u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting overridden odd clearfix\u0022 title=\u0022Overridden\u0022\u003E\n \u003Cspan class=\u0022label\u0022\u003EFormat:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/style_plugin\u0022 class=\u0022views-ajax-link \u0022 title=\u0022Change the way content is formatted.\u0022 id=\u0022views-page-style-plugin\u0022\u003EFullCalendar\u003C/a\u003E\u003Cspan class=\u0022label\u0022\u003E\u0026nbsp;|\u0026nbsp;\u003C/span\u003E\u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/style_options\u0022 class=\u0022views-ajax-link views-button-configure\u0022 title=\u0022Change settings for this format\u0022 id=\u0022views-page-style-options\u0022\u003E\u003Cspan\u003ESettings\u003C/span\u003E\u003C/a\u003E \u003C/div\u003E\n\u003C/div\u003E\n\u003Cdiv class=\u0022views-ui-display-tab-bucket fields overridden\u0022 title=\u0022Overridden\u0022\u003E\n \u003Cdiv class=\u0022ctools-no-js ctools-dropbutton ctools-button views-ui-settings-bucket-operations\u0022 id=\u0022ctools-button-1\u0022\u003E\u003Cdiv class=\u0022ctools-link\u0022\u003E\u003Ca href=\u0022#\u0022 class=\u0022ctools-twisty ctools-text\u0022\u003Eopen\u003C/a\u003E\u003C/div\u003E\u003Cdiv class=\u0022ctools-content\u0022\u003E\u003Cul class=\u0022actions horizontal right\u0022\u003E\u003Cli class=\u0022add first\u0022\u003E\u003Ca href=\u0022/admin/structure/views/nojs/add-item/event_calendar/page/field\u0022 class=\u0022icon compact add views-ajax-link\u0022 title=\u0022Add\u0022 id=\u0022views-add-field\u0022\u003EAdd\u003C/a\u003E\u003C/li\u003E\n\u003Cli class=\u0022rearrange last\u0022\u003E\u003Ca href=\u0022/admin/structure/views/nojs/rearrange/event_calendar/page/field\u0022 class=\u0022icon compact rearrange views-ajax-link\u0022 title=\u0022Rearrange\u0022 id=\u0022views-rearrange-field\u0022\u003ERearrange\u003C/a\u003E\u003C/li\u003E\n\u003C/ul\u003E\u003C/div\u003E\u003C/div\u003E \u003Ch3\u003EFields\u003C/h3\u003E\n \u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting page-field-title even clearfix\u0022 \u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/config-item/event_calendar/page/field/title\u0022 class=\u0022views-ajax-link\u0022\u003EContent: Title\u003C/a\u003E \u003C/div\u003E\n\u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting page-field-field-event-date odd clearfix\u0022 \u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/config-item/event_calendar/page/field/field_event_date\u0022 class=\u0022views-ajax-link\u0022\u003EContent: Event Date\u003C/a\u003E \u003C/div\u003E\n\u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting page-field-field-event-description even clearfix\u0022 \u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/config-item/event_calendar/page/field/field_event_description\u0022 class=\u0022views-ajax-link\u0022\u003EContent: Event Description\u003C/a\u003E \u003C/div\u003E\n\u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting page-field-field-where odd clearfix\u0022 \u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/config-item/event_calendar/page/field/field_where\u0022 class=\u0022views-ajax-link\u0022\u003EContent: Where\u003C/a\u003E \u003C/div\u003E\n\u003C/div\u003E\n\u003Cdiv class=\u0022views-ui-display-tab-bucket filter-criteria\u0022 \u003E\n \u003Cdiv class=\u0022ctools-no-js ctools-dropbutton ctools-button views-ui-settings-bucket-operations\u0022 id=\u0022ctools-button-2\u0022\u003E\u003Cdiv class=\u0022ctools-link\u0022\u003E\u003Ca href=\u0022#\u0022 class=\u0022ctools-twisty ctools-text\u0022\u003Eopen\u003C/a\u003E\u003C/div\u003E\u003Cdiv class=\u0022ctools-content\u0022\u003E\u003Cul class=\u0022actions horizontal right\u0022\u003E\u003Cli class=\u0022add first\u0022\u003E\u003Ca href=\u0022/admin/structure/views/nojs/add-item/event_calendar/page/filter\u0022 class=\u0022icon compact add views-ajax-link\u0022 title=\u0022Add\u0022 id=\u0022views-add-filter\u0022\u003EAdd\u003C/a\u003E\u003C/li\u003E\n\u003Cli class=\u0022rearrange last\u0022\u003E\u003Ca href=\u0022/admin/structure/views/nojs/rearrange-filter/event_calendar/page/filter\u0022 class=\u0022icon compact rearrange views-ajax-link\u0022 title=\u0022Rearrange\u0022 id=\u0022views-rearrange-filter\u0022\u003EAnd/Or, Rearrange\u003C/a\u003E\u003C/li\u003E\n\u003C/ul\u003E\u003C/div\u003E\u003C/div\u003E \u003Ch3\u003EFilter criteria\u003C/h3\u003E\n \u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting page-filter-status even clearfix\u0022 \u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/config-item/event_calendar/page/filter/status\u0022 class=\u0022views-ajax-link\u0022\u003EContent: Published (Yes)\u003C/a\u003E \u003C/div\u003E\n\u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting page-filter-type odd clearfix\u0022 \u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/config-item/event_calendar/page/filter/type\u0022 class=\u0022views-ajax-link\u0022\u003EContent: Type (= Calendar Artist Shows)\u003C/a\u003E \u003C/div\u003E\n\u003C/div\u003E\n\u003Cdiv class=\u0022views-ui-display-tab-bucket sort-criteria\u0022 \u003E\n \u003Cdiv class=\u0022ctools-no-js ctools-dropbutton ctools-button views-ui-settings-bucket-operations\u0022 id=\u0022ctools-button-3\u0022\u003E\u003Cdiv class=\u0022ctools-link\u0022\u003E\u003Ca href=\u0022#\u0022 class=\u0022ctools-twisty ctools-text\u0022\u003Eopen\u003C/a\u003E\u003C/div\u003E\u003Cdiv class=\u0022ctools-content\u0022\u003E\u003Cul class=\u0022actions horizontal right\u0022\u003E\u003Cli class=\u0022add first\u0022\u003E\u003Ca href=\u0022/admin/structure/views/nojs/add-item/event_calendar/page/sort\u0022 class=\u0022icon compact add views-ajax-link\u0022 title=\u0022Add\u0022 id=\u0022views-add-sort\u0022\u003EAdd\u003C/a\u003E\u003C/li\u003E\n\u003Cli class=\u0022rearrange last\u0022\u003E\u003Ca href=\u0022/admin/structure/views/nojs/rearrange/event_calendar/page/sort\u0022 class=\u0022icon compact rearrange views-ajax-link\u0022 title=\u0022Rearrange\u0022 id=\u0022views-rearrange-sort\u0022\u003ERearrange\u003C/a\u003E\u003C/li\u003E\n\u003C/ul\u003E\u003C/div\u003E\u003C/div\u003E \u003Ch3\u003ESort criteria\u003C/h3\u003E\n \u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting page-sort-created even clearfix\u0022 \u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/config-item/event_calendar/page/sort/created\u0022 class=\u0022views-ajax-link\u0022\u003EContent: Post date (desc)\u003C/a\u003E \u003C/div\u003E\n\u003C/div\u003E\n\u003C/div\u003E\u003Cdiv class=\u0022views-display-column second\u0022\u003E\u003Cdiv class=\u0022views-ui-display-tab-bucket page-settings\u0022 \u003E\n \u003Ch3\u003EPage settings\u003C/h3\u003E\n \u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting odd clearfix\u0022 \u003E\n \u003Cspan class=\u0022label\u0022\u003EPath:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/path\u0022 class=\u0022views-ajax-link \u0022 title=\u0022/users/%/Show-Schedule\u0022 id=\u0022views-page-path\u0022\u003E/users/%/Show-Schedule\u003C/a\u003E \u003C/div\u003E\n\u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting even clearfix\u0022 \u003E\n \u003Cspan class=\u0022label\u0022\u003EMenu:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/menu\u0022 class=\u0022views-ajax-link \u0022 title=\u0022No menu\u0022 id=\u0022views-page-menu\u0022\u003ENo menu\u003C/a\u003E \u003C/div\u003E\n\u003C/div\u003E\n\u003Cdiv class=\u0022views-ui-display-tab-bucket access\u0022 \u003E\n \u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting overridden odd clearfix\u0022 title=\u0022Overridden\u0022\u003E\n \u003Cspan class=\u0022label\u0022\u003EAccess:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/access\u0022 class=\u0022views-ajax-link \u0022 title=\u0022Specify access control type for this display.\u0022 id=\u0022views-page-access\u0022\u003ERole\u003C/a\u003E\u003Cspan class=\u0022label\u0022\u003E\u0026nbsp;|\u0026nbsp;\u003C/span\u003E\u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/access_options\u0022 class=\u0022views-ajax-link views-button-configure\u0022 title=\u0022Change settings for this access type.\u0022 id=\u0022views-page-access-options\u0022\u003E\u003Cspan\u003EArtist\u003C/span\u003E\u003C/a\u003E \u003C/div\u003E\n\u003C/div\u003E\n\u003Cdiv class=\u0022views-ui-display-tab-bucket header\u0022 \u003E\n \u003Cdiv class=\u0022ctools-no-js ctools-button views-ui-settings-bucket-operations\u0022 id=\u0022ctools-button-4\u0022\u003E\u003Cdiv class=\u0022ctools-content\u0022\u003E\u003Cul class=\u0022actions horizontal right\u0022\u003E\u003Cli class=\u0022add first last\u0022\u003E\u003Ca href=\u0022/admin/structure/views/nojs/add-item/event_calendar/page/header\u0022 class=\u0022icon compact add views-ajax-link\u0022 title=\u0022Add\u0022 id=\u0022views-add-header\u0022\u003EAdd\u003C/a\u003E\u003C/li\u003E\n\u003C/ul\u003E\u003C/div\u003E\u003C/div\u003E \u003Ch3\u003EHeader\u003C/h3\u003E\n \u003C/div\u003E\n\u003Cdiv class=\u0022views-ui-display-tab-bucket footer\u0022 \u003E\n \u003Cdiv class=\u0022ctools-no-js ctools-button views-ui-settings-bucket-operations\u0022 id=\u0022ctools-button-5\u0022\u003E\u003Cdiv class=\u0022ctools-content\u0022\u003E\u003Cul class=\u0022actions horizontal right\u0022\u003E\u003Cli class=\u0022add first last\u0022\u003E\u003Ca href=\u0022/admin/structure/views/nojs/add-item/event_calendar/page/footer\u0022 class=\u0022icon compact add views-ajax-link\u0022 title=\u0022Add\u0022 id=\u0022views-add-footer\u0022\u003EAdd\u003C/a\u003E\u003C/li\u003E\n\u003C/ul\u003E\u003C/div\u003E\u003C/div\u003E \u003Ch3\u003EFooter\u003C/h3\u003E\n \u003C/div\u003E\n\u003Cdiv class=\u0022views-ui-display-tab-bucket pager\u0022 \u003E\n \u003Ch3\u003EPager\u003C/h3\u003E\n \u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting defaulted even clearfix\u0022 \u003E\n \u003Cspan class=\u0022label\u0022\u003EUse pager:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/pager\u0022 class=\u0022views-ajax-link \u0022 title=\u0022Change this display\u0026#039;s pager setting.\u0022 id=\u0022views-page-pager\u0022\u003EDisplay all items\u003C/a\u003E\u003Cspan class=\u0022label\u0022\u003E\u0026nbsp;|\u0026nbsp;\u003C/span\u003E\u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/pager_options\u0022 class=\u0022views-ajax-link views-button-configure\u0022 title=\u0022Change settings for this pager type.\u0022 id=\u0022views-page-pager-options\u0022\u003E\u003Cspan\u003EAll items\u003C/span\u003E\u003C/a\u003E \u003C/div\u003E\n\u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting defaulted odd clearfix\u0022 \u003E\n \u003Cspan class=\u0022label\u0022\u003EMore link:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/use_more\u0022 class=\u0022views-ajax-link \u0022 title=\u0022Specify whether this display will provide a \u0026quot;more\u0026quot; link.\u0022 id=\u0022views-page-use-more\u0022\u003ENo\u003C/a\u003E \u003C/div\u003E\n\u003C/div\u003E\n\u003C/div\u003E\u003Cdiv class=\u0022views-display-column third ctools-collapsible-container ctools-collapsible-remember ctools-collapsed\u0022 id=\u0022views-ui-advanced-column-event_calendar\u0022\u003E\u003Ch3 class=\u0022ctools-collapsible-handle\u0022\u003E\u003Ca href=\u0022\u0022\u003EAdvanced\u003C/a\u003E\u003C/h3\u003E\u003Cdiv class=\u0022ctools-collapsible-content\u0022\u003E\u003Cdiv class=\u0022views-ui-display-tab-bucket contextual-filters\u0022 \u003E\n \u003Cdiv class=\u0022ctools-no-js ctools-dropbutton ctools-button views-ui-settings-bucket-operations\u0022 id=\u0022ctools-button-6\u0022\u003E\u003Cdiv class=\u0022ctools-link\u0022\u003E\u003Ca href=\u0022#\u0022 class=\u0022ctools-twisty ctools-text\u0022\u003Eopen\u003C/a\u003E\u003C/div\u003E\u003Cdiv class=\u0022ctools-content\u0022\u003E\u003Cul class=\u0022actions horizontal right\u0022\u003E\u003Cli class=\u0022add first\u0022\u003E\u003Ca href=\u0022/admin/structure/views/nojs/add-item/event_calendar/page/argument\u0022 class=\u0022icon compact add views-ajax-link\u0022 title=\u0022Add\u0022 id=\u0022views-add-argument\u0022\u003EAdd\u003C/a\u003E\u003C/li\u003E\n\u003Cli class=\u0022rearrange last\u0022\u003E\u003Ca href=\u0022/admin/structure/views/nojs/rearrange/event_calendar/page/argument\u0022 class=\u0022icon compact rearrange views-ajax-link\u0022 title=\u0022Rearrange\u0022 id=\u0022views-rearrange-argument\u0022\u003ERearrange\u003C/a\u003E\u003C/li\u003E\n\u003C/ul\u003E\u003C/div\u003E\u003C/div\u003E \u003Ch3\u003EContextual filters\u003C/h3\u003E\n \u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting page-argument-uid even clearfix\u0022 \u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/config-item/event_calendar/page/argument/uid\u0022 class=\u0022views-ajax-link\u0022\u003E(author) User: Uid\u003C/a\u003E \u003C/div\u003E\n\u003C/div\u003E\n\u003Cdiv class=\u0022views-ui-display-tab-bucket relationships\u0022 \u003E\n \u003Cdiv class=\u0022ctools-no-js ctools-dropbutton ctools-button views-ui-settings-bucket-operations\u0022 id=\u0022ctools-button-7\u0022\u003E\u003Cdiv class=\u0022ctools-link\u0022\u003E\u003Ca href=\u0022#\u0022 class=\u0022ctools-twisty ctools-text\u0022\u003Eopen\u003C/a\u003E\u003C/div\u003E\u003Cdiv class=\u0022ctools-content\u0022\u003E\u003Cul class=\u0022actions horizontal right\u0022\u003E\u003Cli class=\u0022add first\u0022\u003E\u003Ca href=\u0022/admin/structure/views/nojs/add-item/event_calendar/page/relationship\u0022 class=\u0022icon compact add views-ajax-link\u0022 title=\u0022Add\u0022 id=\u0022views-add-relationship\u0022\u003EAdd\u003C/a\u003E\u003C/li\u003E\n\u003Cli class=\u0022rearrange last\u0022\u003E\u003Ca href=\u0022/admin/structure/views/nojs/rearrange/event_calendar/page/relationship\u0022 class=\u0022icon compact rearrange views-ajax-link\u0022 title=\u0022Rearrange\u0022 id=\u0022views-rearrange-relationship\u0022\u003ERearrange\u003C/a\u003E\u003C/li\u003E\n\u003C/ul\u003E\u003C/div\u003E\u003C/div\u003E \u003Ch3\u003ERelationships\u003C/h3\u003E\n \u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting page-relationship-uid odd clearfix\u0022 \u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/config-item/event_calendar/page/relationship/uid\u0022 class=\u0022views-ajax-link\u0022\u003EContent: Author\u003C/a\u003E \u003C/div\u003E\n\u003C/div\u003E\n\u003Cdiv class=\u0022views-ui-display-tab-bucket no-results-behavior\u0022 \u003E\n \u003Cdiv class=\u0022ctools-no-js ctools-button views-ui-settings-bucket-operations\u0022 id=\u0022ctools-button-8\u0022\u003E\u003Cdiv class=\u0022ctools-content\u0022\u003E\u003Cul class=\u0022actions horizontal right\u0022\u003E\u003Cli class=\u0022add first last\u0022\u003E\u003Ca href=\u0022/admin/structure/views/nojs/add-item/event_calendar/page/empty\u0022 class=\u0022icon compact add views-ajax-link\u0022 title=\u0022Add\u0022 id=\u0022views-add-empty\u0022\u003EAdd\u003C/a\u003E\u003C/li\u003E\n\u003C/ul\u003E\u003C/div\u003E\u003C/div\u003E \u003Ch3\u003ENo results behavior\u003C/h3\u003E\n \u003C/div\u003E\n\u003Cdiv class=\u0022views-ui-display-tab-bucket exposed-form\u0022 \u003E\n \u003Ch3\u003EExposed form\u003C/h3\u003E\n \u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting even clearfix\u0022 \u003E\n \u003Cspan class=\u0022label\u0022\u003EExposed form in block:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/exposed_block\u0022 class=\u0022views-ajax-link \u0022 title=\u0022Allow the exposed form to appear in a block instead of the view.\u0022 id=\u0022views-page-exposed-block\u0022\u003ENo\u003C/a\u003E \u003C/div\u003E\n\u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting defaulted odd clearfix\u0022 \u003E\n \u003Cspan class=\u0022label\u0022\u003EExposed form style:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/exposed_form\u0022 class=\u0022views-ajax-link \u0022 title=\u0022Select the kind of exposed filter to use.\u0022 id=\u0022views-page-exposed-form\u0022\u003EBasic\u003C/a\u003E\u003Cspan class=\u0022label\u0022\u003E\u0026nbsp;|\u0026nbsp;\u003C/span\u003E\u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/exposed_form_options\u0022 class=\u0022views-ajax-link views-button-configure\u0022 title=\u0022Exposed form settings for this exposed form style.\u0022 id=\u0022views-page-exposed-form-options\u0022\u003E\u003Cspan\u003ESettings\u003C/span\u003E\u003C/a\u003E \u003C/div\u003E\n\u003C/div\u003E\n\u003Cdiv class=\u0022views-ui-display-tab-bucket other\u0022 \u003E\n \u003Ch3\u003EOther\u003C/h3\u003E\n \u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting even clearfix\u0022 \u003E\n \u003Cspan class=\u0022label\u0022\u003EMachine Name:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/display_id\u0022 class=\u0022views-ajax-link \u0022 title=\u0022Change the machine name of this display.\u0022 id=\u0022views-page-display-id\u0022\u003Epage\u003C/a\u003E \u003C/div\u003E\n\u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting odd clearfix\u0022 \u003E\n \u003Cspan class=\u0022label\u0022\u003EComment:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/display_comment\u0022 class=\u0022views-ajax-link \u0022 title=\u0022Comment or document this display.\u0022 id=\u0022views-page-display-comment\u0022\u003ENo comment\u003C/a\u003E \u003C/div\u003E\n\u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting overridden even clearfix\u0022 title=\u0022Overridden\u0022\u003E\n \u003Cspan class=\u0022label\u0022\u003EUse AJAX:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/use_ajax\u0022 class=\u0022views-ajax-link \u0022 title=\u0022Change whether or not this display will use AJAX.\u0022 id=\u0022views-page-use-ajax\u0022\u003ENo\u003C/a\u003E \u003C/div\u003E\n\u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting defaulted odd clearfix\u0022 \u003E\n \u003Cspan class=\u0022label\u0022\u003EHide attachments in summary:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/hide_attachment_summary\u0022 class=\u0022views-ajax-link \u0022 title=\u0022Change whether or not to display attachments when displaying a contextual filter summary.\u0022 id=\u0022views-page-hide-attachment-summary\u0022\u003ENo\u003C/a\u003E \u003C/div\u003E\n\u003Cdiv class=\u0022views-display-setting views-ui-display-tab-setting defaulted even clearfix\u0022 \u003E\n \u003Cspan class=\u0022label\u0022\u003EHide contextual links:\u003C/span\u003E\n \u003Ca href=\u0022/admin/structure/views/nojs/display/event_calendar/page/hide_admin_links\u0022 class=\u0022views-ajax-link \u0022 title=\u0022Change whether or n

Anon Ymous

How to limit the words in search api autocomplete suggestion?

4 days 20 hours ago

I have a requirement to limit the words to show up in row of autocomplete suggestion. Now its showing titles but problem is titles are too long and suggestions are covering entire width of the screen. So any way to limit it? I checked with HOOK_search_api_autocomplete_suggestions_alter hook but not getting what is the attribute to limit this feature. Any help will be appreciated.

Suraj

Drupal Planet

Specbee: Drupal Translation Modules: How to create Multilingual Drupal websites

4 days 16 hours ago
Want an easy way to extend your market reach and ultimately your sales? Do you feel you need to personalize your website to every user no matter which country they belong to or what language they speak? Then getting yourself a multilingual website is one of the most effective business strategies you can implement. Not only is it a more cost-effective, it also helps in increasing your website traffic and overall Drupal SEO. Drupal CMS has particularly taken up this challenge of providing not only users but also developers with the ability to access Drupal in a language that they prefer. And with Drupal being multilingual out-of-the-box since version 8, it has become an ideal choice for businesses and developers. Powerful Drupal translation modules offer developers with granular configuration capabilities where every content entity can be translated. Let's dive right in to learn more about the various multilingual Drupal modules. What are Multilingual Websites Multilingual basically means written or available in different languages. Multilingual websites connect better with users from different countries as it immediately adds an element of familiarity. Drupal provides an easy and a great experience of building a multilingual website. Currently, Drupal supports 100 different languages for translation. Drupal multilingual features come along with the installation interfaces. As soon as you install Drupal, based on the browser preference, it provides a language for your Drupal website. Based on the option selected the site is installed in that particular language. It basically provides 4 different Drupal translation modules for language and content translation. We can enable the required Drupal modules on our site and use it according to our requirements.  But first, ensure you're using the latest Drupal version so you can leverage Drupal's built-in multilingual capabilities. Drupal 7 also supports multilingual functionality but requires additional modules and configurations. The four core Drupal translation modules available in Drupal 10: Language module It provides a feature for adding and choosing a new language to your Drupal website. Allows users to configure languages and how page languages are chosen, and apply languages to content. Enable any non-English language for your site's content (one or more) Content translation module This Drupal Translation module allows you to translate content entities such as comments, custom blocks, contents, taxonomy terms, users, etc. Allows you to translate your site content, including pages, taxonomy terms, blocks, etc., into different languages. Interface translation module Translates the built-in user interface, your added modules and themes. Configuration translation module Provides a translation interface for configuration. Allows you to translate text that is part of the configuration, such as field labels, the site name, the views name, the text used in Views,   Let’s catch up with what each Drupal translation module does, its configurations and how each module can be used in our Drupal website. If you're a content writer/editor/marketer, here's a less-technical article especially for you to help you build your first multi-lingual page/website. Install Drupal with Multilingual Support During the installation process, enable the multilingual options. This sets up your Drupal site to handle multiple languages from the start. Make sure to select the appropriate language options during installation. Drupal Language Module Navigate to Configuration > Regional and language > Languages to configure language settings. Here, you can add, enable, and configure languages for your site. Drupal supports a wide range of languages out of the box.   Language Switcher Configuration Set up language switcher blocks or menus to allow users to switch between languages seamlessly. Drupal provides several options for configuring language switchers, including dropdown menus, language blocks, and language negotiation settings. Once the block is placed in the region we will be able to switch to the different languages in the web page itself. Content Translation Module Enable content translation for the content types you want to be multilingual. Navigate to Configuration > Regional and language > Content language and translation to configure content translation settings. This allows content creators to translate content into different languages. It provides a list of entity types that can be translated.  For example, click on the content configuration option that appears for each content type. Let us consider that the content translation is being enabled for the article content type. It provides an option to decide if each subtype entity is translatable or not. We can also change the default language for a particular content type. Each field has an option to translate its content or not.    The Drupal translation modules also provides an option to input the content in the language which is suitable for the user while adding content from the backend interface. Once the above configuration is set up and when we try to add content to the Article content type we can see a Select option with the languages installed in our site. We can select any language and add content in the particular language selected. Once the content is saved, users with translate permissions will see links to Translate their content. It provides an additional tab called “Translate” along with the  "Edit" links, and you'll be able to add translations for each configured language. Interface Translation Module The Drupal Interface translation module is also a part of the core module and can be easily enabled like any other Drupal Translation module. Once this Drupal multilingual module is enabled, it is possible to replace any string in the interface with a string that has been customized. Whenever this drupal translation module encounters any string, it tries to translate the particular string to the current language of the interface. If a particular translation is not available it is remembered and we can look up into the untranslated string in the table.    Navigate to Configuration > Regional and language > Interface translation to manage interface translations. In the above example, the strings which are both translated and untranslated are displayed and we are able to modify the strings for the language that is installed as well. The Drupal translations for the strings are put up in a single place called http://localize.drupal.org and the Localization Update module will automatically import the updated translation strings for your selected language. In Drupal 7 and previous versions, this was a contributed module. Since Drupal 8 and higher however, this multilingual Drupal module is a part of the core. Drupal Configuration Translation Module The Drupal Configuration Translation module allows configuration to be translated into different languages. The site name, views name, and other configurations can be translated easily using this Drupal multi language module. It also provides an option to input the content in the language which is suitable for the user while adding content from the backend interface. Once the above configuration is set up and when we try to add content to the Article content type we can see a Select option with the languages installed in our site. We can select any language and add content in the particular language selected. URL Language Detection and Handling Configure language detection and handling for URLs. Drupal allows you to set up different URL structures for different languages, such as domain.com/en/ for English and domain.com/es/ for Spanish. Configure language detection methods and URL patterns under Configuration > Regional and language > Languages > Detection and selection. SEO Considerations Ensure your multilingual Drupal site is SEO-friendly by using proper hreflang tags and canonical URLs. Drupal provides modules like the hreflang module to help manage hreflang tags for multilingual content. Additionally, configure proper language-specific meta tags and URL structures for better search engine visibility. Testing and Quality Assurance Thoroughly test your multilingual Drupal site to ensure that language switching, content translation, and interface translations work correctly across all pages and languages. Pay close attention to user experience and ensure that all translated content is accurate and contextually appropriate. Shoutout to Manish Saharan for helping us update this article! Final Thoughts Having a Drupal multilingual website is a great way to building better and stronger relationships with users and prospective customers. Drupal offers 100 languages to choose from to translate your website effectively. With Drupal translation modules in core, developers now find it easier to install and adapt to a multilingual environment while providing businesses with great digital experiences.As a leading Drupal development company, we provide comprehensive Drupal services which also includes building multilingual Drupal websites keeping in mind the needs of our global clientele.

Web Wash: Download and Install Drupal Starshot

4 days 16 hours ago

Drupal Starshot is a new packaged and pre-configured version of Drupal that was announced at DrupalCon Portland. It is not a separate fork or rewrite of Drupal.

Drupal Starshot takes advantage of the new Recipes feature introduced in Drupal versions 10.3 and 11.

Recipes allow installing Drupal with a complete, ready-to-use website, going beyond the standard installation profile.

More details about the Drupal Starshot initiative are available on its official page.