Questions tagged [theming]

Use it for questions about rendering or modifying the HTML markup produced by a module/theme.

Filter by
Sorted by
Tagged with
0
votes
2answers
2k views

Define variables for template files

I am trying to move the first chunk of code including the PHP logo call, and the breadcrumbs into the header region. I have created the block, and made it capable of reading PHP. I understand I need ...
0
votes
0answers
1k views

Quick edit with custom twig templates

I am trying to get quick edit to work in combination with my twig templates where i only print out specific fields like this: {{content.field_teaser_overline}} The rendered markup of the field looks ...
0
votes
0answers
229 views

Expand menu links down in a tree

I'm using Nice menus, but it expands children sub menus to right only. I want it so that when you hove on main parent link, it drop-downs a sub-menu with all its children submenus expanded down in a ...
0
votes
2answers
6k views

Using prefix and suffix form api layout

I have created a form, though I'm having an issue with using the prefix and suffix to place items into rows rather than the list they appear as standard. For example I have these 3 form elements, how ...
0
votes
2answers
638 views

(Views) How to style an image field conditionally based on term

I have a Drupal website in which there is a content type named Article. In that content type, there is a taxonomy field called "Topic" which is term reference field pointing to a vocabulary called ...
0
votes
2answers
103 views

Packing taxonomy fields into one div not from SQL?

I created 2 taxonomy entity-reference fields. One is Categories and one is Tags and some similar other fields. In nodes, some of these taxonomy fields appear one above the other. I want to give some ...
0
votes
4answers
5k views

How to use CSS preprocessor LESS.js with Drupal 7?

I would like to use LESS, the CSS preprocessor, with Drupal 7 projects. What are the required steps to use LESS in Drupal?
0
votes
1answer
60 views

How to wrap a whole view in a tpl file?

I created a view and I'd like to wrap it with a link in a template file. I've never worked with custom template files for views, so I've no idea where to start. How can I do this?
0
votes
1answer
242 views

theme table from drupal 6 to drupal 7

I try to rewrite the node output and i don`t get it. This script produce only <table></table> without any content. $rows = array(); $cols = array(); $cols[] = '<div id="node-title"...
0
votes
1answer
138 views

View scanning wrong template file [closed]

I've inherited a Drupal 7 site that's having an issue. The field "date" appears on the test site, but not on prod, and the field "title" is linked on test, but not prod. On both sites, the "date" ...
0
votes
1answer
3k views

Remove or rename menu's <li> class .last

I need to remove class .last from menu's <li>. I browsed this nice website for a solution and find some code that removes ALL classes: function THEME_menu_link(array $variables) { //unset all ...
0
votes
1answer
1k views

Comparing node creation and modification dates in twig

I want to compare a node's creation date and modified date in Twig, and it drives me bonkers. I've looked at various examples and snippets as part of this, this, this or this external source. Using ...
0
votes
1answer
234 views

Raw Field Value in Views

We have a content type that has a Video Embed Field. In this field, we simply enter youtube or Vimeo url. In a custom view we are trying to display the raw value of the field. Since this is a Video ...
0
votes
1answer
57 views

In a view how to replace the date of creation of the comment by the date of the flag?

I created a "like" flag on the nodes. I created a view that displays the comments. I want my view to show only comments posted since the flag date. The solution will be to create a filter criteria ...
0
votes
1answer
17 views

Display level-3 submenu on twig

I'm creating a node--page.html.twig and I'm using twig_tweak to help render a block for my sidebar to display Level-3 links on my menu. Currently, most of my pages are displaying correctly because ...
-1
votes
2answers
868 views

How to unset content or hide content from node by ID or by path alias? [closed]

Create content for a custom content type "Artist" (Add Content > Artist) Note the node number (/node/[number]). Set an URL alias for the node. node/[number] to /details/[node:field_artist_title] I ...
-1
votes
2answers
85 views

Naming a template file

D7, bartik. A comment form is created by an .inc file (modulename.page.inc). This comment form is to comment on existing comments. To create the comment form, the inc page says: function ...
-1
votes
2answers
8k views

How to calculate a date difference in twig?

I am using date range field in views and would like to display dates in the format 5-May +3 days using twig. Te values that can be used as per drupal are: {{ field_mycontent_dates__value }} == Raw ...
-1
votes
1answer
155 views

How do I print the local task bar in different places depending on the base route?

I want to print the local task bar used when users register/login/reset password at another part of the page, than the other local task bars. The base route for these menu links is user.page. https:/...
-1
votes
4answers
470 views

Use module to change custom type theme

I have built a module that adds a new custom type. I want to control the theme of that node type, and use a custom theme page for that node type. I can't find any documentation about this. How can ...
-1
votes
3answers
622 views

How to replace drupal-render-placeholder manually?

I've got the element with following plain string (result of some kind of side effect): <drupal-render-placeholder callback="Drupal\block\BlockViewBuilder::lazyBuilder" arguments="0=myform&...
-1
votes
1answer
977 views

How to get views header and footer in view block template

I have created view as block and in block twig template i can print view fields as content['#view'].field['field_machine_name'].value(row) HOw can i print text in textarea that i set as header and ...
-2
votes
1answer
55 views

How to enable template while creating node

I want to enable different template for different node while creating node. for eg: I am creating blog1 node, then while creating blog1 node I should be able to choose template in drupal 7. Please ...
-2
votes
2answers
565 views

Why is HTML rendering as Plain Text in a simple 'title' alteration?

I have been able to change each node's Comment Link 'title' text (that on default renders 'Add new comment') with the below code, but if I add HTML, it renders as plain text. I'm trying to add a ...
-2
votes
1answer
551 views

How to enable or disable the “Add to Cart” button for products based on the role of the store owner?

I have Drupal 8 and Commerce 2. I created a "Merchant" and "Premium Merchant" role. By default, users who create a store have the "Merchant" role. What I am trying to do is the following. If the ...

1
16 17 18 19
20