question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

category images not showing

See original GitHub issue
{% category_tree depth=2 as tree_categories %}
{% for category, info in tree_categories %}
    {% if info.level == 0 %}
        <li><a href="{{ category.get_absolute_url }}"><i
                class="fa fa-{{ category.icon }} dropdown-menu-category-icon"></i>{{ category.name }} </a>
            {% if info.has_children %}
                . . .
    {% category_tree depth=1 parent=category as sub_categories %}
    {% for sub_category, info in sub_categories %}
    <div class="col-md-4">
        <a href="{{ sub_category.get_absolute_url }}">
            <h5 class="dropdown-menu-category-title">
                {#here only the first category is shown with image, the rest is without image#}
                {% thumbnail sub_category.image "100x100" upscale=False as thumb %}
                    <img
                            src="{{ thumb.url }}"
                            alt="{{ sub_category.name }}"
                            title="{{ sub_category.name }}"
                    />
                {% endthumbnail %}
                {{ sub_category.name }}

            </h5>
        </a>
            <ul class="dropdown-menu-category-list">
                {% category_tree depth=1 parent=sub_category as sub_sub_categories %}
                {% for ss_category, info in sub_sub_categories %}
                    <li>
                        <a href="{{ ss_category.get_absolute_url }}">{{ ss_category.name }}</a>
                        <p>{{ ss_category.description|safe }}</p>
                    </li>
                {% endfor %}
            </ul>
        </div>
    {% endfor %}
                ...
                {% if info.level == 0 %}   {# Here image is shown  #}
                    {% thumbnail category.image "300x300" upscale=False as thumb %}
                        <img class="dropdown-menu-category-section-theme-img"
                             src="{{ thumb.url }}"
                             alt="{{ category.name }}" title="{{ category.name }}"
                             style="right: 10px;"/>
                    {% endthumbnail %}
                {% endif %}
                </div>
                </div>
            {% endif %}
        </li>

    {% endif %}
{% endfor %} ```

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
alientt-tonycommented, Mar 18, 2019

any updates here? I’m trying django-oscar with lightsail + nginx and i can’t also see the images. Any help here?

Thanks.

2reactions
MRdevXcommented, May 19, 2018

i’m using django-oscar, and i faced the same issue. i installed sorl thumbnail 12.4a1, but it didn’t fixed the problem. any ideas? or new solutions? thanks a lot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Category Image not showing | WordPress.org
After editing the text of a category, the category image stopped displaying. It shows in the category edit section but not on the...
Read more >
Pictures / Images not showing in category page after updating ...
A common issue is that Magento is looking for the pictures in the old cache files that are missing after the upgrade as...
Read more >
Category images are not displaying in WordPress
I am able to get the category name and description but I am not getting the category image. I tried the below code....
Read more >
Product Category Images Not Showing in the Front - Crocoblock
In this quick fix, we shed the light on two methods you can use to output the WooCommerce product category thumbnail in the...
Read more >
WordPress Featured Image Not Showing Properly (Or Not At All)
To edit featured images in WordPress, open a post and scroll to the Featured Images section in the Post Settings panel. Click the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found