This forum is for assistance with theme development.

Drupal8 form twig template rendering issue

Hi,

I am trying to pass a drupal8 form to Twig template. For this I have created a Twig Extension and call the function from Twig Template. The issue I am facing was the form elements not rendering in Twig template. Also I have directly paste the form html code to Twig file this method also not working. Anyone please help me to resolve this issue.

Following are the code snippets I am using in my custom module.

My Twig Extension function:-

[solved] How to include image in teaser of custom content type?

Hello.
Trying to make the image appear within its node teaser in front page for all nodes of a custom content type. I've searched and found quite a few threads (in this forum and Stack Overflow) but the closer I got was getting the URI to the image folder (not even to the image.

I guess I'd have to edit my 'node-contenttypename.html.twig' but not sure if any other file should be affected.

Search box does not follow the action attribute in the form

I have a problem in creating the search box template for my custom template (using Drupal 8).
Basically, the search box has the correct address in the "action" attribute of the "form" element (http://www.mydomain.com/my-site/en/search/site).
But when you click the search button the action url "becomes" wrong (http://www.mydomain.com/en/find/whatever).

Render image field as background image in twig not working

I have a block that has some fields that are rendered as part of a content type. In the block twig template file I am trying to render the image as a div background using:

<div style="background-image: url('{{ file_url(content.field_masthead_image['#items'].entity.uri.value) }}');">

I have also created a field for masthead_image in the content type. However, the image is not being rendered at all. I've checked permissions on the folder where the images are stored and they are 755. Any suggestions would be welcome.

Vertically repeat avatars (Advanced Forum)

...and set them as background of the forum post's author-pane

In advanced-forum.naked.structure.css i narrowed down the .forum-post-wrapper to 150px width.

This should be a panel for vertically repeating user pictures. an endless strip, as long as the posts get...

Do i have to define (.user-picture) as a CSS background, the picture print to a CSS class? If yes, how?
Thanks!

Edit: This is how it should look like.jpg

How can I output second search form with another form ID?

Hi there,
I use Bootstrap and D7 and I need to output two search forms with different design (another placeholder, icon and text for button etc). For single search from I not have any problem, I use theming via form_alter custom function into template.php.
I think, for the problem solving I can output second search form with another ID, then change form via form_alter. But I not have any ideas, how can I render second search form with new form ID.
Anybody help my? Thx for any answer.
Regards, Anatolii.

Pages

Subscribe with RSS Subscribe to RSS - Theme development