Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hi! I'm building a portfolio and i need to do the following filter:
Code: Select all
         <ul id="portfolio-filter">
               <li class="active"><a href="#" class="filter" data-filter=".destacado">Destacados</a></li>
            <li><a href="#" class="filter" data-filter=".estandar">Estandar</a></li>
               <li><a href="#" class="filter" data-filter=".auto">Autoadministrable</a></li>
            <li><a href="#" class="filter" data-filter=".tienda">Tienda Virtual</a></li>
         
   
            </ul>
         
            <section id="portfolio-items">
            <ul class="portfolio">

                <cms:pages masterpage='portafolio.php' >
                <li>
                    <!-- Gallery Item -->
                    <article class="col-md-3 project" data-tags="<cms:show filtro />"  >
                      <!--div class="img-container-image">-->
                      <div>
                        <!-- Image -->
                        <a href="<cms:show k_page_link />" title="click para ver demo" TARGET="_blank" class="" >
                            <img src="<cms:show thumb />" alt="Click en la imágen para ver demo">                 
                        </a>
                      </div>
                        <span><cms:show k_page_title /></span>
                    </article>               
                  </li>
                 </cms:pages>
            
            </ul>
          </section>   


Where in
Code: Select all
<li><a href="#" class="filter" data-filter=".estandar">Estandar</a></li>
I build the filter's kind "data-filter=".estandar"" and in this line
Code: Select all
<article class="col-md-3 project" data-tags="<cms:show filtro />"  >
the filter works, exactly in " data-tags="<cms:show filtro />" " . Just in that part of my code I need add more than 1 filter, for example "data-tags="filter1, filter2, filter3" " separated for comma.
How can i to do this?? add the comma separator?
You are using <cms:show filtro /> within cms:pages, so I assume 'filtro' is an editable region.

Not sure what type of editable region that is but I'd define it as 'checkbox' e.g.
Code: Select all
<cms:editable 
    name='filtro'
    opt_values='destacado | estandar | auto | tienda'
    type='checkbox'
/>

This way we can select multiple values.

On the frontend we can generate a comma-separated string of all the selected values like this -
Code: Select all
data-tags="<cms:each filtro ><cms:show my_sep/><cms:show item /><cms:set my_sep=', ' /></cms:each>"
Does this help?
Wua!!!!!! Thank you very much!!! you are great!!!!!
Its exactly what i need.

Saludos desde Chile!
Greetings from Chile!
You are welcome :)
4 posts Page 1 of 1
cron