IsoGallery

Display and manage Isotope galleries!

Back to IsoGallery Support

Hessel
Hessel

I would like to extend your amazing plugin a little bit to my needs, therefore I added a button in the model for show/hide single portfolio item on the front-end. In the component the output would be 1 or 0. However I don't know how create an if/else statement to display the item if 0. Your help would be really great!

Kind regards!

UpTop
UpTop

Hi!

If you could post your component's code that would be of great help. Without any context something like this should do the trick:

{% if item.button is false %}
// You code here
{% endif %}
Hessel
Hessel

Thank you for the reply, the button works now, the item is invisible on the front-end on pageload. However when I click on one of the gallery catgories in the isogallery navigation the item in not invissible anymore. How can I solve this last part? My component looks like this:

<div id="r59-isogallery" class="photo-component">

<div class="align-center uppercase photo-navigation ">
    <ul class="portfolio-filters inline-list">
        <li class="btn btn-success iso-nav-btn filter-active" data-category="*"><a>Alles</a></li>
        {% for category in categories %}
        <li class="btn btn-success iso-nav-btn" data-category=".{{category.slug}}"><a>{{category.title}}</a></li>
        {%endfor%}
    </ul>
</div>

<ul class=" photos-container portfolio-items clean-list" data-grid="li">
    {% for gallery in galleries %}
        <li  {% if gallery.test == false %}  style="display:none;"; }  {% endif %} class="photo col-lg-05 col-md-3 col-sm-4 col-xs-6 {% for category in gallery.categories %}{{category.slug}} {%endfor%}">
            <figure>            
                <a href="/{{gallery.url}}"><img src="{{gallery.photos.0.path}}" class="strip" data-strip-group="photos-{{loop.index}}" alt="portfolio image"></a>  

                <figcaption>
                    <div class="portfolio-hint">
                        <h4>{{ gallery.title }}</h4>                                                  
                        <ul class="inline-list align-center">
                            <a href="/{{gallery.url}}"><li class="bg-white"><i data-icon="ios-eye-outline" data-icon-size="36" data-icon-color="#fbc698"></i></li></a>
                        </ul>
                    </div>
                </figcaption>           
            </figure> 
        </li>
    {% endfor %}
    </ul>

</div>    

Your support would be a great help.

UpTop
UpTop

If you want to exclude the item from your html you could do something like this:

<ul class=" photos-container portfolio-items clean-list" data-grid="li">
  {% for gallery in galleries %}
    {% if gallery.test != false %}  
      //html code
    {% endif %}
  {% endfor %}
</ul>

The use case is not entirely clear to me, but please let me know if you need any further assistance! Otherwise you can contact me on slack. My username is @CptMeatball ;)

Last updated

Hessel
Hessel

Great it works thank you.

1-5 of 5