Forum
Search results
Looking for some quick guidance before I spend hours trying to do something that Perch cannot. I am using the Blog App and through the series of provided templates, I return 'results' via Category and Tag searches of actual blog entries, title, download link, image, description.
What I would like to do is return the search results with the same content.
The search template opens up result_url, result_title and result_excerpt, but I cannot see anyway to allow an associated image or link to be made available, i.e.
<div class="blog-image">
<perch:if exists="image">
<img src="<perch:search id="result_image" type="image" class="img-responsive" width="143" height="96" crop="true" />" alt="<perch:search id="result_title" />" />
</perch:if>
</div>
or similarly for a download link
<perch:if exists="download">
<h4><a href="<perch:search id="result_download" type="file" bucket="downloads" />" alt="<perch:search id="result_title" />" target="_blank"><perch:search id="result_title" type="text" /></a></h4>
Obviously the above would not work, but just wondering if I can, I suppose, miss a step and return a listing of Blog entries from the Search, rather then a list of search results, which link to individual blog entries and hence avoid the two clicks.
Hope this makes sense.
Wondered if I had to somehow pass a variable into the template and then make some call to retrieve the data, but that is starting to get quite convoluted and I wondered if there was something more obvious that I am missing or if infact, the search element cannot do this,
Thanks,
Andy
Your fields should be available under their original IDs. The idea of the
result_
prefix is to stop our IDs clashing with yours.If you add the following to the template, can you see your fields?
No, none of the fields are being exposed. So for example, if in my search result template I have:
No values are being shown.
I am obviously not doing something correct. With the search, it is passing the value of my querystring to the Blog Search page and as such, as you say, all your result_prefix IDs are being presented.
However, no perch:blog IDs are being presented or even if I change them to perch:search and my IDs
Can you post your diagnostics?
Below is the full Monty. Please note, for ease I stated that everything was perch_blog, but what I have done is created copies to use as news and resources. I have not tried it on the news app, but resources is not working.
These are direct working copies of the blog app and all features work, so I do not believe it is an issue from how I have copied and renamed it, unless search cannot handle perch:resources, but could handle perch:blog ?
Noticed in the latest blog update you CAN make copies, but this is for Runway. As you can see this installation is diet Perch :-)
#
Hosting settings
If you've made your own apps based on Blog, we can't really support those.
Multiple blogs is a Runway-only feature. I'm sure the time saved working around it would quickly pay for the £139 difference.
Yes, I'm sure, I've just not used Runway or even opened up what would be involved in a change over of platform.
I will redo the app as a standard Blog and then perhaps we can see if it works or not. I have a feeling it will not, irrespective of the calls being perch:blog and or perch:news, perch:whatever........
Anyway, great product(s) and let's see.
I will get a license and play around.
That feature exists, so I'm pretty sure it should work. If it's not working we can work with you to figure out why. We just can't do that on an unknown copy of the app.
Fair enough. I can deploy the element without the search feature and then I will take a look at this when I have a bit more time.
As the site is live and this is an addition, I might quickly deploy the Blog app and see if I can get the functionality working. If not, I will come back.
Then, once things are settled, I think it's time to buy a Runway license and start playing around.
Cheers