drupal-views

How to create a counter with TWIG?

落爺英雄遲暮 提交于 2020-06-29 06:42:58
问题 I have a site with Drupal 8 and I want to create a task counter with TWIG. I use views with conditions. The counter must be incremented whether the view has a result or not. Here is the code I just made : <span class="badge badge-warning task-badge-warning"> {% if drupal_view_result('boutique_page_liste_des_taches_produit_non_publie', 'block_1') is not empty %} 1 {% endif %} {% if drupal_view_result('boutique_page_liste_des_taches_role_marchand', 'block_1') is empty %} 1 {% endif %} </span>

How to create a counter with TWIG?

余生颓废 提交于 2020-06-29 06:42:11
问题 I have a site with Drupal 8 and I want to create a task counter with TWIG. I use views with conditions. The counter must be incremented whether the view has a result or not. Here is the code I just made : <span class="badge badge-warning task-badge-warning"> {% if drupal_view_result('boutique_page_liste_des_taches_produit_non_publie', 'block_1') is not empty %} 1 {% endif %} {% if drupal_view_result('boutique_page_liste_des_taches_role_marchand', 'block_1') is empty %} 1 {% endif %} </span>

Measurement sheets in Drupal 6

人盡茶涼 提交于 2020-02-04 18:42:51
问题 I'm doing a project for a surveying company in Drupal 6. Ultimately, employees will need to enter measurements into a new content type. Currently they do it in a big Excel spreadsheet that has a bunch of macros to do calculations between cells (Meters to Feet, m^2, some pricing stuff). My question is: How would one go about replicating the functionality of this spreadsheet best in Drupal 6 , keeping in mind the amount of data the employees using this system gather varies between projects (I.e

Measurement sheets in Drupal 6

北城余情 提交于 2020-02-04 18:42:30
问题 I'm doing a project for a surveying company in Drupal 6. Ultimately, employees will need to enter measurements into a new content type. Currently they do it in a big Excel spreadsheet that has a bunch of macros to do calculations between cells (Meters to Feet, m^2, some pricing stuff). My question is: How would one go about replicating the functionality of this spreadsheet best in Drupal 6 , keeping in mind the amount of data the employees using this system gather varies between projects (I.e

displaying a Drupal view without a page template around it

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-28 13:18:08
问题 I would like to display a Drupal view without the page template that normally surrounds it - I want just the plain HTML content of the view's nodes. This view would be included in another, non-Drupal site. I expect to have to do this with a number of views, so a solution that lets me set these up rapidly and easily would be the best - I'd prefer not to have to create a .tpl.php file every time I need to include a view somewhere. 回答1: I was looking for a way to pull node data via ajax and came

displaying a Drupal view without a page template around it

浪子不回头ぞ 提交于 2020-01-28 13:17:57
问题 I would like to display a Drupal view without the page template that normally surrounds it - I want just the plain HTML content of the view's nodes. This view would be included in another, non-Drupal site. I expect to have to do this with a number of views, so a solution that lets me set these up rapidly and easily would be the best - I'd prefer not to have to create a .tpl.php file every time I need to include a view somewhere. 回答1: I was looking for a way to pull node data via ajax and came

How to display sibling pages except current page in drupal 7?

给你一囗甜甜゛ 提交于 2020-01-15 18:51:26
问题 Suppose I have parent pages A1 and B1. A1 has child pages A1.1, A1.2,A1.3 and B1 has child pages B1.1, B1.2. When I am on page A1.1 I shall be able to display A1.2 and A1.3. Same for A1.2, I shall be able to see A1.1 and A1.3. If I am on page B1.1, I shall see B1.2 and vice versa. Note: Every page has an image and a title. I want to get a solution using views. This thread may be linked to this link if we need the child pages: How to list all child pages of current parent page in drupal 7? 回答1

Ignore “The” when sorting a View in Drupal

淺唱寂寞╮ 提交于 2020-01-15 05:09:06
问题 How can I ignore "The" when the user sorts a view in a Drupal site ? 回答1: Have you tried looking into the Views Natural Sort Module ? taken from module page linked above.. Provides a views filter that sorts titles by a more natural manner by ignoring articles like "The" and "A." 来源: https://stackoverflow.com/questions/3189092/ignore-the-when-sorting-a-view-in-drupal

Is a drupal View useful for this use case

瘦欲@ 提交于 2020-01-14 09:28:32
问题 I have a list of nodes that I want to present to the user. The user then picks 3 and I need to remember that decision so I can present them in a smaller list later (your choices list). To present the full list of nodes, I will just use views to get all published nodes. The question is how do I store those 3 choices so I can pull them in the "your choices list"? What structure should I use to save them? create a content type called list or use views. Not sure, or there's something more logical

How do I add custom fields in a view?

北慕城南 提交于 2020-01-13 20:22:45
问题 I have created a view in Drupal 7, and used "Table" as format. How can I add my own fields to that table? 回答1: One method is, in your view, click 'add' for fields, then filter by 'Global', and you will get 4 types of custom fields to add. Global: Contextual Links Global: Custom text Global: Math expression Global: View result counter Another method is to make use of Views Custom Field module. 来源: https://stackoverflow.com/questions/15162343/how-do-i-add-custom-fields-in-a-view