Forum

Thread tagged as: Question, Blog

Displaying custom fields in Search Results

Hi!

How can i display on my template custom fields ? For instance, I have a field in my Blog app thats call, "imgPost", I would like to use it as a thumbnail in my search result. But the results never return any of my custom fields (to avoid confusion, by custom I mean fields that I added to the blog Post template).

Here is my search-result template

<li class="grid-style">
   <article id="post-239" class="item">
   <div class="thumbnail">
      <perch:showall />
      <perch:if exists="imgPost">
         <a class="penci-image-holder" style="background-image: url('<perch:blog id="imgPost" />
            ');" href="
            <perch:search id="url" />
            " title="
            <perch:search id="title" />
            ">
         </a>
         <a href="<perch:search id="url" />
            " class="icon-post-format">
            <perch:if exists="link">
               <i class="fa fa-link"></i>
               <perch:else/>
               <perch:if exists="quotes">
                  <i class="fa fa-quote-left"></i>
                  <perch:else/>
                  <perch:if exists="sound">
                     <i class="fa fa-music"></i>
                     <perch:else/>
                     <perch:if exists="slideshow">
                        <i class="fa fa-picture-o"></i>
                        <perch:else/>
                        <i class="fa fa-align-justify"></i>
                     </perch:if>
                  </perch:if>
               </perch:if>
            </perch:if>
         </a>
         <perch:else/>
         <a class="penci-image-holder" style="background-image: url('newsbanner.jpg');" href="<perch:search id="url" />
            " title="
            <perch:search id="title" />
            ">
         </a>
         <a href="<perch:search id="url" />" class="icon-post-format"><i class="fa fa-align-justify"></i></a>
      </perch:if>
   </div>

Here is an example of the search result:

showall

Gustavo Bica

Gustavo Bica 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

At the current time, if you don't see the value you want in perch:showall then it's not yet available to display.