This forum is for assistance with theme development.

Page with content that contains items

May I ask about best practice. Say I have a content type called Widgets and then I want to have a Widgets page which has a title, maybe some photos and a text based introduction and then below a list of widgets in a grid. I have always created a Basic Page where I have added my introductory content and then I have created a custom page template where I have added a block (which is a views block listing the widgets I want displayed. Is this best practice?

[SOLVED] Field TWIG: how to split 'prefix', 'content' and 'suffix'?

Hello,
a 'test' content type has an integer field with prefix and suffix.

Exploring Layout Builder Challenges: Crafting a Puzzle-Style layout with Sidebars on Drupal 9-10 using Layout Builder

How can the Layout Builder be employed to craft a Drupal layout resembling the puzzle-style arrangement depicted in the image "Web 1920 – 1.jpg ," where the sidebar operates as a region content managed by the Layout Builder? What particular challenges emerge in this scenario, distinct from the standard two or three-column layout conventions as illustrated in "Web 1920 – 2.jpg"?

Editing a link to a file

The original template (file-link.html.twig) sets a.title to the file name. I want a.title to display the file description field.
Is it the right and safe solution?

file-link.html.twig

How to get styled image in custom Views?

I have create custom template for my Views as shown below:

  •  views-view-unformatted--article_category_blocks--article-category-1.html.twig

Print the content of first row:

{{ rows[0].content }}

The image (field_image) has styled with "thumbnail" style in my Views.

Now, how to print the styled "thumbnail" field_image?

Inherite theme suggestions created by the parente theme

I have a theme X that implements X_theme_suggestions_page_alter. It adds a new template suggestions named "page__fwidth" for some content types.

When the theme X is enabled the theme loads the file named page--fwidth.html.twig for the desired content type.

Now, if I create a sub-theme Y that has X as the base theme and activate it, the suggestion defined by X is not available. Probably because the file X/X.theme is not loaded. How can I have all the stuff in X.theme loaded when the theme Y is activated?

Thank you

Pages

Subscribe with RSS Subscribe to RSS - Theme development