live-weather.html.twig in Live Weather 8.2
Same filename and directory in other branches
Template for the live weather list block
Available variables:
- weather_detail: array of weather list.
1 theme call to live-weather.html.twig
- LiveWeatherBlock::build in src/
Plugin/ Block/ LiveWeatherBlock.php - Builds and returns the renderable array for this block plugin.
File
templates/live-weather.html.twigView source
- {#
- /**
- * @file
- * Template for the live weather list block
- *
- * Available variables:
- * - weather_detail: array of weather list.
- */
- #}
- {% spaceless %}
- <div class="live-weather-list">
- {% for var in weather_detail %}
- <div class="live-weather">
-
- <div class="city"><h3>{{ var.location }}</h3></div>
- <div class="temperature">
- <span class="label"> {{ 'Temperature'|t }} </span>
- <span class="data">{{ var.temperature }} °{{ var.temperature_unit }} {{ var.text }}</span>
- </div>
-
- {% if var.image %}
- <div class="image">
- <span class="data"><img src="{{ var.image }}.png"/></span>
- </div>
- {% endif %}
-
- {% if var.wind %}
- <div class="wind">
- <span class="label">{{ 'Wind speed'|t }} </span>
- <span class="data">{{ var.wind }}</span>
- </div>
- {% endif %}
-
- {% if var.humidity %}
- <div class="humidity">
- <span class="label">{{ 'Humidity'|t }} </span>
- <span class="data">{{ var.humidity }}</span>
- </div>
- {% endif %}
-
- {% if var.visibility %}
- <div class="visibility">
- <span class="label">{{ 'Visibility'|t }} </span>
- <span class="data">{{ var.visibility }}</span>
- </div>
- {% endif %}
-
- {% if var.sunrise %}
- <div class="sunrise">
- <span class="label">{{ 'Sunrise'|t }} </span>
- <span class="data">{{ var.sunrise }}</span>
- </div>
- {% endif %}
-
- {% if var.sunset %}
- <div class="sunset">
- <span class="label">{{ 'Sunset'|t }} </span>
- <span class="data">{{ var.sunset }}</span>
- </div>
- {% endif %}
-
- </div>
- {% endfor %}
- </div>
- {% endspaceless %}