Account created on 25 October 2008, about 16 years ago
#

Recent comments

I will try to nail down the bug, but it's quite a challenge due to the number of modules I have installed.

now there's Alinks which provides most of Word Link's functionality:

https://www.drupal.org/project/alinks

yes, I am already using it and I have been contributing ideas to its development too, quite a few have been implemented by the theme's developer, Alaa Haddad. I think he's doing a great job by making Drupal themeing more accessible, many thanks to him!

even then, Solo was far from an ideal solution, especially when it first came out as D8W3CSS, for which I made a custom subtheme and then custom sub sub themes for all my websites.

but this way of working is not upgrade-resistant and there are some issues to consider like modularity, i.e. being able to change the module taking care of navigation, mobile navigation, not having to override the base theme's CSS sheets to avoid CLS, etc.

This is really something that should have been taken care of by the Drupal project, i.e. delivering Drupal Core with a simple theme that doesn't need drush, recompiling css or whatever, and at the same time offers high flexibility and performance, instead of Olivero's grid column layout with hard coded menus, etc. Olivero was a nice technical demonstration but it didn't make it easy for beginners.

I am glad Solo is developing in that direction, Solo provides a solution for people stuck with the out of the box Drupal that doesn't like to be easily themed by non-coders and will contribute to growing Drupal's userbase.

the issue with the options setting I described in #17 is that while everything is correct on the metatags level, the breadcrumbs displayed on the website show the page title twice, once with a link and once without a link, such as:

home (link) > big category (link) > subcategory (link) > current page title (link) - current page title (no link)

okay, please activate the following options and see what happens:

- Include the current page as a breadcrumb segment
- Make the current page title segment a link

and finally, the issue with the module is the following:

"If the current page is not a link, it won't be added."

the question is not whether the current page should be a link or not, the problem is that the module won't add the current page to the breadcrumblist UNLESS it's a link.

@leymannx

how about this example from the same page ?

{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
  "itemListElement": [{
    "@type": "ListItem",
    "position": 1,
    "name": "Books",
    "item": "https://example.com/books"
  },{
    "@type": "ListItem",
    "position": 2,
    "name": "Authors",
    "item": "https://example.com/books/authors"
  },{
    "@type": "ListItem",
    "position": 3,
    "name": "Ann Leckie",
    "item": "https://example.com/books/authors/annleckie"
  }]
}

the example on schema.org also has a link:
https://schema.org/BreadcrumbList

{
 "@context": "https://schema.org",
 "@type": "BreadcrumbList",
 "itemListElement":
 [
  {
   "@type": "ListItem",
   "position": 1,
   "item":
   {
    "@id": "https://example.com/dresses",
    "name": "Dresses"
    }
  },
  {
   "@type": "ListItem",
  "position": 2,
  "item":
   {
     "@id": "https://example.com/dresses/real",
     "name": "Real Dresses"
   }
  }
 ]
}

@spuky

https://developers.google.com/search/docs/appearance/structured-data/bre...

unless I'm mistaken, the above google spec for breadcrumbs says all breadcrumbs should have a link associated ?

I want to provide google with the corresponding metadata, but also display a neat breadcrumb to the user.

@spuky

thanks for your comment, but could you please explain more ?

the current page needs to go into the schema breadcrumbs.
how do you propose to achieve this ?

that's what happens when waiting for 7 years before merging patches

here another example, this time about vertical padding.
the attached screenshot show the lower right corner of a website.

the google map block and the footer should be directly joined without spacing, as most other elements on websites I make.

so in most cases, with the old D8W3CSS, I had to eliminate/override the dreaded w3css-padding which seemed to be applied to almost everything, or w3row-padding, etc.

overriding it in style.css caused CLS, because the base css was loaded first.

a solution could be to override the css librar(ies) responsible for the padding, but then this makes a re-work necessary every time a new version with new css comes out.

so I instead had to include these styles inline with !important, which is a bit inefficient and causes "unused css" warnings in lighthouse.

other use cases include using a block to show a header image, a flexslider slideshow, a background video, a picture as a design element within the page flow, etc.

another example is how the pictures join on their corner on the screenshot (this uses paragraphs).

these cases happen more often than not - I never had the case where the default paddings were what the designer wanted.

the option to specify 0 padding would be useful, so sitebuilders could then just include/import custom CSS files from within the TWIG template so they get cached correctly.

but maybe you have another/better way of achieving the same result.

most of my experience comes from D8W3CSS, I didn't work much with SOLO so far.

I think your work can be very significant for the Drupal project by making themeing accessible.
Olivero might have been a good technical showcase and easy to use for advanced Drupal users, but Olivero forced design choices on the user and was difficult to use and customize for the average sitebuilder.
The alternative is Bootstrap... 4 or 5.
But here again, SASS, node.js, git... compiling styles... and maybe using some drush as well... Bootstrap is not for the average windows-based sitebuilder.

themeing is one of the main obstacles why people don't use Drupal and one of the main reasons why corporations tend to use headless Drupal.

Windows-based sitebuilders which want a simple but flexible, easily customizable, free and opensource Drupal theme do not have a lot of choices.

Imagine a theme that would allow average windows-based sitebuilders (which don't use drush or node.js) to customize it into any desired appearance without sacrificing update compatibility and performance ?

I will have more time later to give more examples, but let's start with this one from https://unitedstarsofamerica.com/

On the picture you can see how content is not justified.

Some designs will have no boxes/borders, so on a fixed width template, the design will call for justifying content to the left (and right) edge of content width, so that would be an example of left and right padding = 0.

I'm a bit late to the party, but the module "Menu Item Extras" uses its own TWIG template.

So to resolve your problem, you should make a template override by integrating the functionality of Menu Item Extra's template into the Olivero template.

menu item extras uses its own menu template, that's why the menu didn't get the proper classes for Solo.

so I will have to create a Frankentemplate that supports both.

a simple theme would be one that doesn't require sass, node.js, etc. and does not require drush too.

why doesn't the uninstall function take care of this ?

DXPR is a commercial product.
Bootstrap 5 is quite rigid and requires compiling CSS and installing node.js / gulp, can be a challenge on Windows.

I basically have the same problems as the OP.

I'm looking for a ready to use theme for Drupal that is pre-configured to offer:

  • useful breakpoints and responsive image styles
  • paragraphs with carousels, galleries, accordions, etc.
  • a full set of flexible regions for all use cases
  • no profile installation, only using contrib modules
  • optimized for performance
  • [...] I probably forgot some needed features, but that's the essentials

I tried that of course, but for some reason I was unable to change the menu links from a preprocess function from within mytheme.theme

who is closing unresolved issues, especially lying by marking it as "fixed" ?

my current workaround is making two dummy links in the main menu and then replace label and url with the correct values:

/**
 * use two dummy links in the main menu as language links
 */
/*
use Drupal\Core\Url;
function ***mytheme***_preprocess_menu__main(&$variables) {
  // Retrieve the current route.
  $route_match = \Drupal::routeMatch();
  $route_name = $route_match->getRouteName();

  // Get the list of enabled languages.
  $enabled_languages = \Drupal::languageManager()->getLanguages();

  // Get the current language.
  $current_language = \Drupal::languageManager()->getCurrentLanguage()->getId();

  // Define an array to store shortened language codes and their associated URLs.
  $menulangArray = [];

  // Check if the current route corresponds to a node page.
  if ($route_name == 'entity.node.canonical') {
    // Retrieve the current node.
    $node = $route_match->getParameter('node');

    // Proceed only if a node is found.
    if ($node) {
      // Iterate through the enabled languages.
      foreach ($enabled_languages as $langcode => $language) {
        // Check if the current node has a translation in the language.
        if ($node->hasTranslation($langcode)) {
          // Get the translated node in the current language.
          $node_translation = $node->getTranslation($langcode);
          if ($node_translation->isPublished()) {
            // If the translation is published, add its URL to menulangArray.
            $url = $node_translation->toUrl()->setOption('language', $language)->setAbsolute()->toString();
            // Shorten the language code to 2 characters.
            $shortLangcode = substr($langcode, 0, 2);
            // Check if the language is the current language and add "is-active" class.
            $class = ($current_language == $langcode) ? 'is-active' : '';
            $menulangArray[$shortLangcode] = ['url' => $url, 'class' => $class];
          }
        }
      }
    }
  } else {
    // For other entities like views or custom pages, generate language-specific URLs.
    foreach ($enabled_languages as $langcode => $language) {
      // Get the current path.
      $current_path = \Drupal::service('path.current')->getPath();
      
      // Generate language-specific URLs.
      $url = Url::fromUserInput($current_path, ['language' => $language])->setAbsolute()->toString();
      // Shorten the language code to 2 characters.
      $shortLangcode = substr($langcode, 0, 2);
      // Check if the language is the current language and add "is-active" class.
      $class = ($current_language == $langcode) ? 'is-active' : '';
      $menulangArray[$shortLangcode] = ['url' => $url, 'class' => $class];
    }
  }

  // Iterate through main menu items and replace the URLs.
  foreach ($variables['items'] as &$item) {
    if (isset($item['title'])) {
      // Iterate through menulangArray to find a matching key.
      foreach ($menulangArray as $shortLangcode => $data) {
        if ($item['title'] === $shortLangcode) {
          // Preserve existing attributes of menu items.
          $attributes = isset($item['attributes']) ? $item['attributes'] : [];

          // Replace the URL of the menu item with the generated URL.
          $item['url'] = Url::fromUri($data['url']);
          
          // Add the "is-active" class if it's the current language.
          $attributes['class'][] = $data['class'];

          // Set the updated attributes.
          $item['attributes'] = $attributes;

          // Break out of the loop once a match is found.
          break;
        }
      }
    }
  }
}

@FeyP
thank you for your answer.

things get more complicated when I want to display "en" instead of "en-gb".

the problem with the other modules is that they do not add the links to an existing menu.

so I am left without a solution at the moment.

this part of themeing is really tricky

I'm closing this as I found a workaround.
I probably had borked something in JQuery.

In my opinion, the strength of the SIDR module comes from being able to place several blocks in it and its flexibility/configurability.

Other solutions tend to concentrate on specific areas, such as mobile off-canvas menu and stop there.

What about if we want to use a different menu for mobile, what if we want to include a logo, another block?

@pameeela
if I knew if the bugs were related or duplicates, it would mean I knew the exact nature of the bug, but I don't.

@yorchperaza thank you for your work, I will test it.
This will be a very neat functionality if it works.

Hello and thanks for these great date modules

I have been experimenting with smart date and date content augmenter and have a different idea about the process.

Here is how I imagine it :

Let's imagine an example for course lectures and rooms, and a user adds the dates and content.

The expected behaviour would be:
User creates a new "Course" and adds Lectures into the same form in the smart date field.
In each smart date field, he types a title, a formatted text and specifies a room (referenced entity).

Currently, the "Date Content" must be added using Content -> Date Content, which is not workable for end users.

I think the date content type should be configurable in the smart date widget in the form display settings of the parent entity where the smart date field is used.

would this patch also work as a dynamic block in the manner of a view block, using a token or a node's place ID?

ah thanks!

it's this old issue again:
https://www.drupal.org/project/drupal/issues/2642122 🐛 Overriding already overridden libraries-override requires knowledge of previous libraries-overrides Needs work

silly me, I even forgot I wrote a reminder about it
https://drupaldope.com/drupal-9-tricks/drupal-themeing-overriding-librar...

nice brain fail on my part, thank you for the pointer !

Needs steps to reproduce

As the OP mentioned, the steps to reproduce, as of Drupal 10.2.4 are:

- install Drupal using for example German as a first default language
- enable English
- do some stuff, create content, etc.
- enable UI, config and content translations

(maybe all of the above steps aren't necessary to reproduce the bug)

then:
- go to languages /admin/config/regional/language and change the label of both languages, for example, name Deutsch "de" and English "en"

maybe it will first appear to work. maybe not.
if you do something else, like adding content in one or the other language, one might jump back to the original name "Deutsch" or "English".

The strange thing is that the YML config item shown by DEVEL is all correct.

If trying to add translations to the language names, an error message will appear "English translation was not added. To add a translation, you must modify the configuration."

Sometimes there is no error message, and the translation seemingly gets accepted, but the name of the language will jump back to the original anyway, even if on the languages page /admin/config/regional/language everything seems normal and both are displayed as "de" and "en", but either Deutsch or English will appear as its original name no matter what settings.

after doing something else on the site, ONE of the labels on the languages page /admin/config/regional/language will revert back to original.

it's very frustrating.

this bug has been going on for years and has been reported in one form or another many times.

I wrote more about it here:
https://www.drupal.org/project/drupal/issues/3337864#comment-15540567 🐛 Configuration language is not adjusted after changing the site default language Active

never mind the workaround, one of the language labels reverted back to original after doing something else on the site.

Dear Alaa

Yes, of course I understand, it's your design decision and I'm merely making suggestions.

I feel I don't completely understand the accessibility argument, because expand on hover only adds this feature for computers and afaik doesn't change anything on touch devices. But maybe there is something I am missing in my understanding.

Regarding the side where the menu opens, this could also be toggled via theme options, open submenu left or right, in general the website designer will know which side will be better depending on the site's general layout.

I did achieve that effect by minimally hacking the JS and adding some CSS, no PHP involved. I'm ready to share the code with you if you aren't afraid of losing brain cells because what you will see ;-)

Thank you again for your work, I understand "The Solo theme, like many other themes available for Drupal, is made to help you build a wide variety of websites."
That is exactly my goal also - I hope at some point to have a boilerplate theme that will have a nice standard look by itself, directly usable for simple sites, but also be easily adaptable to build a variety of websites with it.

My dream would be a W3CSS base theme, a W3CSS boilerplate theme (subtheme of W3CSS base) and then the final website's specific theme (subtheme of W3CSS boilerplate).

Many thanks again.

I can now also confirm the workaround to correct this issue on running sites.

First, install an additional language.
Then change the language of all localized content to that new language you just installed.
That may be nodes, blocks, media, redirects and URLs, etc.

Then delete the language of which you can't change the name (be careful, this will delete all content you forgot to switch to the new language).

Purge the cache and then re-install the language you just deleted.

Edit the name of that language to what you wanted and then change the contents' language back to what it was.

So it seems like something screws up the language settings when installing the site or when declaring a language default.

there is actually more to this issue.

languages need a translatable label, which would resolve the present issue and a dozen more related issues I have found today when going down this rabbit hole.

BUT
languages also need editable labels that will be displayed in translations, verbose translations and abbreviated translations, URLs ...

So for example, a site could have installed British English and it would display the following way :
"en-gb" (non translatable) in any technical-related stuff such as hreflang, html, etc.
"British English" (translatable) in any configuration dialog in the admin interface, translation forms, etc.
"en" (translatable) as a label for language switcher links
and potentially, the site owner would want something else (translatable) to be displayed in the URL, such as /eng/ or /english/ or ... whatever

so the short ISO language code would be used by Drupal to identify the language and source translations, and would be untranslatable.
and then there should be 3 translatable labels on top.

Actually I had it working correctly on a site where I did the following :

Installed the site in English

Added German
Added British English
Deleted English

works.

so you mean, what was achieved is exactly the opposite of the intended solution to a problem that didn't exist before ?

It seems that someone has been changing some things in how languages work.

I am now unable to rename a certain language (D 10.2.4).
I wanted to name English en and German de.
The YML configuration is correct, but when the page is shown in the default original language German, it will just say "Deutsch" no matter what.
I guess the new code changes fail to retrieve and display the correct label.

same problem here.
my input vars are at 10000

Thank you for your very fast reply.

I wouldn't want to do this via template, because menus are used in several places on the site, and it's in general less scalable than a preprocess function or similar.

The problem is, neither menu preprocess nor the hook you mentioned seem to work.

I have tried different things in the theme's .theme file, such as

function mytheme_language_switch_links_alter(array &$links) {
    if (isset($links['en']['link'])) {
      $links['en']['link']['#title']->setLinkTitle('en');
    }
}

or

function mytheme_language_switch_links_alter(array &$links) {
  if (isset($links['en']['link']['#title'])) { 
    $links['en']['link']['#title'] = 'en'; 
  }
}

and none seems to work

by the way, did you test that with paragraphs ?

thanks !!

I usually don't even think about an original language because when I work in a language, I also think in that language, and because the admin interface also changes language when I edit, I'm completely blind to it, I don't even notice what language I'm working in.

okay, here is more weird information:

I have just updated a site from 9.5.11 to 10.2.4 on my local windows environment. everything is working well there.

then, I uploaded the working site to the server (same PHP version)

symptoms :
- theme was not applied
- after entering login details to /user/login , brwoser is redirected to /antibot with message "
Submission failed
You have reached this page because you submitted a form that required JavaScript to be enabled on your browser. This protection is in place to attempt to prevent automated submissions made on forms. Please return to the page that you came from and enable JavaScript on your browser before attempting to submit the form again.
"

now the ultra weird part :
I had uninstalled antibot (by using uninstall option in the admin interface) before upgrading the site to avoid this exact problem... so antibot should not even be active.

please disregard.
I missed the catch 22 about the permissions problem.

excellent article, thanks for linking!
I have been singing praise for Drupal 10 as well.

doesn't Drupal's cache live in the database though ?

Thanks for the suggestion, it's indeed quite interesting, yet it's again for a whole site (as far as I understood).

thank you, that project is interesting, but I think it responds to another need and the scope is too large/overkill and requires much additional infrastructure.

so I ended up here as well ... this bug is 7 years old, the first patch too, and we still apply patches ...

(thank you for the patches, BTW!)

thanks Ravi, I had hoped for an easier solution !

yes.

the errors seem to appear every time after the cache is cleared

I noticed it happens when the image gallery is more narrow than its container, for example add just 2 pictures in a 2 column layout.

this will mess up block positions, right ?

is there a way for blocks to memorize their placement in different themes ?

ah, the 2.0 beta version.

thank you, I will try that one.

turns out the module's description is wrong then.

yes, currently no module offers the functionality to set font-family in ckeditor5

but: you can use styles to achieve the same result.

and I think this module is still under development and the goal is to ultimately provide also a font selector.

Production build 0.71.5 2024