<p>I hope I got your issue right. For the brand I'd use a category. So each article can be assigned to a category brand.</p>

<p>You can then group your entries by category:</p>

<pre><code>{# Save entries, group by category #}
{% set entries = entry.children | group( 'entryCategory.first().title' ) %}

{# Get all category logos for the category group "yourEntryCategoryHandle" #}
{% set brands = craft.categories.group( 'yourBrandCategoryHandle' ).titles %}

{# Loop through the category title array #}
{% for brand in brands %}

    {# Get the entries grouped under the current brand title #}
    {% set brandEntries = entries[ '' ~ category ] | default( [] ) %}

    {# Print the category title and entries #}
    {% if brandEntries | length %}
    &lt;div class="image"&gt;
        &lt;img class="img-responsive" src="{{ brand.image.first.url }}" alt="{{ brand.image.first.title }}"&gt;
    &lt;/div&gt;
    &lt;div class="row"&gt;
        {% for entry in brandEntries %}
            ...
        {% endfor %}
    &lt;/div&gt;
    {% endif %}

{% endfor %}
</code></pre>

<p>This is a modification from this issue: <a href="https://craftcms.stackexchange.com/questions/9212/how-do-i-group-entries-by-category-and-retain-fixed-category-order">How Do I group entries by Category and retain fixed Category Order?</a></p>

CC BY-SA 3.0
2017-05-03T08:13:19.383Z
I have not used categories before, but this looks very promising :) thanks for the reply! will get back to you if this solves it when I have figured out how the catogories work.
laden
CC BY-SA 3.0
2017-05-04T09:05:12.973Z
Sure, actually they work pretty much the same as channels/structures do. They help you relate content to certain general categorizations. So, in this case you can create an asset field that contains the brand and use the brand name as title and you're good to go. Then create a category field and add it to your product/entry to be able to select the category. But as @carlcs wrote, better place to discuss this is Craft Slack channel – its community is great and very helping.
Max Strebel
CC BY-SA 3.0
2017-05-03T07:36:20.387Z
2017-05-03T07:36:20.387Z
Max Strebel
<p>I have an image grid for my articles, and its sorted by the type of articles. So all the articles of a certain type is all put in the same item grid, but I want to sort it after the brand aswell by having my image grid sort under a logo of the brand. So if I have 2 different brands of 1 type of article, I want 2 image grids on the same page, neatly sorted under their respective logo.</p>

<p>This is what I have so far:</p>

<pre><code>&lt;div class="widewrapper weak-highlight"&gt;
&lt;div class="container content"&gt;       
    {% for entry in entry.children %}
    {% if entry.type=="lift" and entry.liftMerke=="nifty" %}
    &lt;div class="image"&gt;
        &lt;img class="img-responsive" src="/uploads/images/logo-brand1" alt=""&gt;
    &lt;/div&gt;
    &lt;div class="row"&gt;
        {% for entry in entry.children %}
        {% if entry.type=="lift" and entry.liftMerke=="nifty" %}               
        &lt;div class="showroom-item col-sm-4 col-md-3 col-lg-3"&gt;
            &lt;div class="image"&gt;
                {% set bilde = entry.bilde.one() %}
                {% if bilde %}
                &lt;img class="img-responsive" src="{{ bilde.geturl('fremsideKnapper') }}" alt=""&gt;
                {% endif %}
                &lt;a class="overlay" href="{{ entry.url }}"&gt;
                     &lt;i class="glyphicons search"&gt;&lt;/i&gt;
                     &lt;div class="name"&gt;&lt;p&gt;{{ entry.title }}&lt;/p&gt;&lt;p&gt;Arbeidshøyde: {{ entry.arbeidshoyde }}&lt;/p&gt;&lt;/div&gt;
                &lt;/a&gt;
                &lt;a 
                    href="{{ entry.url }}" 
                    class="btn btn-default btn-gantic btn-xs btn-block"&gt;
                    &lt;h3&gt;{{ entry.title }} | {{ entry.arbeidshoyde }}&lt;/h3&gt;
                &lt;/a&gt;
            &lt;/div&gt;
        &lt;/div&gt;                    
       {% endif %}
       {% endfor %}            
    &lt;/div&gt;
    {% endif %}
    {% endfor %}  
    &lt;div class="clearfix"&gt;&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p></p>

<p>So this gives me just a whole bunch of logos whitch is not what I want. Is there something I can do to make it search through the entry.children articles, and do something only once(print logo) if something is true for either one of the articles? Really appreciate any help!</p>

<p>EDIT:</p>

<p>So I have been playing around with this abit now, but I cant really get it to work. I forgott to mention something inportant in my post aswell, I am using craft3 beta. </p>

<p>So I am abit unsure if the errors I am encountering are me not really understanding what I am doing or if it is related to differences between craft 2 and 3. </p>

<p>I created a catogory group(liftmerker) and two catogories(denka, nifty). I added a image field(image field is called "bilde") to the catogories where I uploaded the logos.</p>

<p>This is what the code looks like at the monent:</p>

<pre><code>&lt;div class="widewrapper weak-highlight"&gt;
&lt;div class="container content"&gt;       
    {% set entries = entry.children | group( 'entryCategory.one().title' ) %}
    {% set brands = craft.categories.group( 'liftmerker' ).titles %}
    {% for brand in brands %}
        {% set brandEntries = entries[ '' ~ category ] | default( [] ) %}
        {% if brandEntries | length %}
        &lt;div class="image"&gt;
            &lt;img class="img-responsive" src="{{ brand.bilde.first.url }}" alt="{{ brand.first.title }}"&gt;
        &lt;/div&gt;

    &lt;div class="row"&gt;
            {% for entry in brandEntries %}
                ...
            {% endfor %}        
    &lt;/div&gt;
        {% endif %}
    &lt;div class="clearfix"&gt;&lt;/div&gt;
    {% endfor %}
&lt;/div&gt;
</code></pre>

<p></p>

<p>This gives me an error that I dont really understand:</p>

<pre><code>TypeError
Argument 1 passed to craft\web\twig\Extension::groupFilter() must be of the type array, object given, called in /home/vagrant/Code/Gantic/Gantic3/storage/runtime/compiled_templates/c3/c383e9d48f1c478076ea5c1b97037f5aa9b4242fb3b6dcb877a0488b0b8b32b7.php on line 114
</code></pre>

<p>Any suggestions for what I can do different or what line in the code is causing the error?</p>

CC BY-SA 3.0
2017-05-03T11:13:58.790Z
I just voted to close this. Craft Stack Exchange is not a good place to post Craft beta issues. Please post this on https://github.com/craftcms/cms or start a discussion in the #craft3 channel in Craft Slack.
carlcs
<templating>
is it posible to have dynamic Title for my article image grid?
# is it posible to have dynamic Title for my article image grid?

(Asked by: username_0 on 2017-05-03)

I have an image grid for my articles, and its sorted by the type of articles. So all the articles of a certain type is all put in the same item grid, but I want to sort it after the brand aswell by having my image grid sort under a logo of the brand. So if I have 2 different brands of 1 type of article, I want 2 image grids on the same page, neatly sorted under their respective logo.
This is what I have so far:

       
    {% for entry in entry.children %}
    {% if entry.type=="lift" and entry.liftMerke=="nifty" %}
    
        
    
    
        {% for entry in entry.children %}
        {% if entry.type=="lift" and entry.liftMerke=="nifty" %}               
        
            
                {% set bilde = entry.bilde.one() %}
                {% if bilde %}
                
                {% endif %}
                
                     
                     {{ entry.title }}Arbeidshøyde: {{ entry.arbeidshoyde }}
                
                
                    {{ entry.title }} | {{ entry.arbeidshoyde }}
                
            
                            
       {% endif %}
       {% endfor %}            
    
    {% endif %}
    {% endfor %}  
    



So this gives me just a whole bunch of logos whitch is not what I want. Is there something I can do to make it search through the entry.children articles, and do something only once(print logo) if something is true for either one of the articles? Really appreciate any help!
EDIT:
So I have been playing around with this abit now, but I cant really get it to work. I forgott to mention something inportant in my post aswell, I am using craft3 beta. 
So I am abit unsure if the errors I am encountering are me not really understanding what I am doing or if it is related to differences between craft 2 and 3. 
I created a catogory group(liftmerker) and two catogories(denka, nifty). I added a image field(image field is called "bilde") to the catogories where I uploaded the logos.
This is what the code looks like at the monent:

       
    {% set entries = entry.children | group( 'entryCategory.one().title' ) %}
    {% set brands = craft.categories.group( 'liftmerker' ).titles %}
    {% for brand in brands %}
        {% set brandEntries = entries[ '' ~ category ] | default( [] ) %}
        {% if brandEntries | length %}
        
            
        

    
            {% for entry in brandEntries %}
                ...
            {% endfor %}        
    
        {% endif %}
    
    {% endfor %}



This gives me an error that I dont really understand:
TypeError
Argument 1 passed to craft\web\twig\Extension::groupFilter() must be of the type array, object given, called in /home/vagrant/Code/Gantic/Gantic3/storage/runtime/compiled_templates/c3/c383e9d48f1c478076ea5c1b97037f5aa9b4242fb3b6dcb877a0488b0b8b32b7.php on line 114

Any suggestions for what I can do different or what line in the code is causing the error?

**Tags:** templating
> **Comments:**
> **username_1**: I just voted to close this. Craft Stack Exchange is not a good place to post Craft beta issues. Please post this on https://github.com/craftcms/cms or start a discussion in the #craft3 channel in Craft Slack.  

---

## 1 answers

### Answer by username_2 on 2017-05-03. Score: 2

I hope I got your issue right. For the brand I'd use a category. So each article can be assigned to a category brand.
You can then group your entries by category:
{# Save entries, group by category #}
{% set entries = entry.children | group( 'entryCategory.first().title' ) %}

{# Get all category logos for the category group "yourEntryCategoryHandle" #}
{% set brands = craft.categories.group( 'yourBrandCategoryHandle' ).titles %}

{# Loop through the category title array #}
{% for brand in brands %}

    {# Get the entries grouped under the current brand title #}
    {% set brandEntries = entries[ '' ~ category ] | default( [] ) %}

    {# Print the category title and entries #}
    {% if brandEntries | length %}
    
        
    
    
        {% for entry in brandEntries %}
            ...
        {% endfor %}
    
    {% endif %}

{% endfor %}

This is a modification from this issue: How Do I group entries by Category and retain fixed Category Order?

> **Comments:**
> **username_0**: I have not used categories before, but this looks very promising :) thanks for the reply! will get back to you if this solves it when I have figured out how the catogories work.  
> **username_2**: Sure, actually they work pretty much the same as channels/structures do. They help you relate content to certain general categorizations. So, in this case you can create an asset field that contains the brand and use the brand name as title and you're good to go. Then create a category field and add it to your product/entry to be able to select the category. But as @carlcs wrote, better place to discuss this is Craft Slack channel – its community is great and very helping.  

---

