This forum is for assistance with theme development.

Add current data value as filter in view

Hello, I want to add my current user data "Privilège" (which is a checkbox list containing "Gold" and "Silver" values) as a filter criteria of my view "List articles". 

In "liste articles", I've already added some criteria (such as the date). 

In my user data, I have a select where I can choose "Gold" or "Silver". 

If the user is Gold, I want to show only Gold article (same for Silver). If the user has no Privilege, show all articles.

I want this to be done as much as possible in backend, how can I do that ? 

Break Tags in Menu Items

Hi , I want to add break tags in menu item titles.

I added one menu item with title as "test <br/> cases". But it is not considering html tags in title. It is displaying as normal text.

my menu-main.html.twig file is like this.

Fields integer statement in twig template

Hello, I wanted to make a condition on an integer field. but the conditions do not work.
{% for item in items %}
    <div{{ attributes }}>{{ item.content }}
        {% if item.content   > 1 %}
            bedrooms
        {% else %}
            bedroom
        {% endif %}
    </div>
{% endfor %}
Do you have a solution please?

Thank you

Custom Query for a node type list and homepage

I have the node type Books, and i'd like that content/books would not show all books but 10 at a time, and in a specific order, and to be able to filter them.

Also I'd like to show 10 specific books on the frontpage, but the thing is that this 10 books change accordying to an api request.

I think its really simple and i'd like to avoid using Views, is it views the only and best way to do this?

Where do I change what is feeding content/books ? Should this be part of a theme or a module?, and if its a module what is the hook?

UI Kit Info and Libray YML

This is driving me mad.

I'm trying to load UI Kit the old fashioned way (without using an extension). I'm setting up my info.yml and libraries.yml. I can load the UI Kit framework CSS just fine, but can't seem to get the JS file to be included.

Here's what I have for the Info.yml:

One Google Map with a few location pins

What combination of modules would I need to setup a single map on a Drupal 7 site that would allow me to add nodes with locations that are shown on the map. For example store locations with a pin that can be click to show full details of each individual location?

Pages

Subscribe with RSS Subscribe to RSS - Theme development