Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hi,

Another funny request.

How can we have only pages display in search results, not folders?

I tried many solutions, nothing works, so far.

Thanks for any help,
Paul
Hi Paolo,

Could you please let me know more details of this issue?
I presume you are using <cms:search> - so what are the ways you have tried, what is the output you keep getting and what you expect to get?

Thanks.
Hi KK,

It's pretty straight forward.

I have my images in gallery folders, and I want to display only pages results, not folders.
I mean excluding the folders results from search, as my clients only need to see pages for their inquiry purpose. :D

Like at : https://www.vietnampaintings.com/search/?s=hopper&nc=1

Is this possible?

The code is basic for a search page:

Code: Select all
<cms:search masterpage='NOT blog.php' >
               
                                <cms:if k_paginated_top >
                               
                            <div class="col-xs-12 alignflex m50">
                                       
                                       <h3><cms:show k_total_records /> pages found</h3>
                                     
                                    </div>
                        
                            </cms:if>
                     
                     <br />
   
                           
          <div class="col-xs-12 col-sm-6 col-md-3 col-lg-2">
         
              <div class="clearthumb">   
                    <div class="item">
                       
           
              <a href="<cms:show k_page_link/>" target="_blank">
                 
                        <cms:if gg_thumb>
                    <amp-img class="unknown-size" width="200" height="200" alt="<cms:show k_search_title />" src="<cms:show gg_thumb />" ></amp-img>   

                        <cms:else/>

                    <amp-img class="unknown-size" width="200" height="200" alt="<cms:show k_search_title />" src="<cms:show k_site_link />images/logo.jpg" ></amp-img>   

                        </cms:if>
               
                  <br/>
               <span class="title"><cms:show k_search_title /></span>
               </a>
           
              </div>
             </div>
         </div>
           
                     
                             
                               
                                <cms:no_results>
                                    <div id="noresult" class="alignflex">
                                    <h3>No result for the search: <cms:show k_search_query /></h3>
                                    </div>
                                </cms:no_results>
                           
                            </cms:search>   


Thanks
SOLVED!

Since nobody had a clue, I solved it dirty, but it works in my case, as only pages with products have gg_image.

Code: Select all
<cms:if gg_thumb>
    <div class="col-xs-12 col-sm-6 col-md-3 col-lg-2">
        <div class="clearthumb">   
            <div class="item">
                <a href="<cms:show k_page_link/>" target="_blank">
                <amp-img class="unknown-size" width="200" height="200" alt="<cms:show k_search_title />" src="<cms:show gg_thumb />" ></amp-img>   
                  <br/>
               <span class="title"><cms:show k_search_title /></span>
                </a>
            </div>
         </div>
    </div>
</cms:if>


Simple.
:geek:
Hey Paolo, I PMed you a week back but the message still sits unread in my outbox.
I think the email associated with your forum account is unreachable. Can you please check and rectify it?
5 posts Page 1 of 1