Forum

Thread tagged as: Problem, Discussion, Blog

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

Andrew Kennedy

Andrew Kennedy 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

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?

<perch:showall />

No, none of the fields are being exposed. So for example, if in my search result template I have:

<perch:blog id="image" />
<perch:blog id="postTitle" />
<perch:blog id="download" />

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

Drew McLellan

Drew McLellan 2638 points
Perch Support

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 :-)

#
Perch: 2.8.15
Production mode: Production (100)
Installed apps: content (2.8.15), assets (2.8.15), categories (2.8.15), perch_events (1.9.2), perch_forms (1.8.3), perch_news (4.6), perch_resources (4.6), perch_twitter (3.5.1)
DB driver: PDO
DB tables: perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_events, perch2_events_categories, perch2_events_to_categories, perch2_forms, perch2_forms_responses, perch2_navigation, perch2_navigation_pages, perch2_news_authors, perch2_news_comments, perch2_news_index, perch2_news_posts, perch2_news_posts_to_tags, perch2_news_sections, perch2_news_tags, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_authors, perch2_resources_comments, perch2_resources_index, perch2_resources_posts, perch2_resources_posts_to_tags, perch2_resources_sections, perch2_resources_tags, perch2_resources_to_tags, perch2_settings, perch2_twitter_scheduled_tweets, perch2_twitter_settings, perch2_twitter_tweets, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 1
App runtimes:

<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_twitter',
        'perch_forms',
        'perch_events',
        'perch_news',
        'perch_resources'
    );

Scheduled tasks for perch_events: update_category_counts (60 mins)
Scheduled tasks for perch_news: delete_spam_comments (1440 mins)
Scheduled tasks for perch_resources: delete_spam_comments (1440 mins)
Scheduled tasks for perch_twitter: post_tweets (1 mins), update_tweets (10 mins)
Editor plug-ins: markitup, redactor
H1: ccc10485860c53b69662a6f45d75d393
L1: ff16c6aaa38eaf387db1378480e6b1a7
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.8: done
latest_version: 2.8.15
on_sale_version: 2.8.15
headerScheme: light
dashboard: 1
content_hideNonEditableRegions: 1
hide_pwd_reset: 0
content_frontend_edit: 0
logoPath: /admin/resources/Thrombosis-UK-Logo-Final.png
perch_twitter_update: 3.5
update_2.8.10: done
update_2.8.11: done
update_2.8.13: done
perch_events_update: 1.8
perch_events_detail_url: /event.php?s={eventSlug}
perch_news_update: 5.0
perch_news_post_url: /news/post.php?s={postSlug}
perch_news_slug_format: %Y-%m-%d-{postTitle}
perch_news_akismet_key:
perch_news_max_spam_days: 0
perch_news_comment_notify: 0
update_2.8.15: done
perch_resources_update: 5.0
perch_resources_post_url: /resources/post.php?s={postSlug}
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: kdl_thrombosisuk
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/London
PERCH_EMAIL_FROM: andrew@kennedydigitalltd.com
PERCH_EMAIL_FROM_NAME: Andrew Kennedy
PERCH_LOGINPATH: /admin
PERCH_PATH: E:\KDL_Projects_Open\kdl_ThrombosisUK\website\www\admin
PERCH_CORE: E:\KDL_Projects_Open\kdl_ThrombosisUK\website\www\admin\core
PERCH_RESFILEPATH: E:\KDL_Projects_Open\kdl_ThrombosisUK\website\www\admin\resources
PERCH_RESPATH: /admin/resources
PERCH_SCHEDULE_SECRET: thrombosisuksecret
PERCH_YOUTUBE_API_KEY: AIzaSyCMLmb86O8CcZkwQkXyGtI7fgGXCzGcwKk
PERCH_HTML5: 1
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: E:\KDL_Projects_Open\kdl_ThrombosisUK\website\www\admin\templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile

Hosting settings

PHP: 5.6.3
Zend: 2.6.0
OS: WINNT
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: f373ea5dd5538761406a8022a4b8a374418b240e $
MySQL server: 5.6.21
Extensions: Core, bcmath, calendar, ctype, date, ereg, filter, ftp, hash, iconv, json, mcrypt, SPL, odbc, pcre, Reflection, session, standard, mysqlnd, tokenizer, zip, zlib, libxml, dom, PDO, bz2, SimpleXML, wddx, xml, xmlreader, xmlwriter, apache2handler, openssl, curl, mbstring, exif, gd, gettext, mysql, mysqli, Phar, pdo_mysql, pdo_sqlite, soap, sockets, sqlite3, xmlrpc, xsl, mhash
GD: Yes
ImageMagick: No
PHP max upload size: 800M
PHP max form post size: 800M
PHP memory limit: 1000M
Total max uploadable file size: 800M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
MIBDIRS: E:/xampp/php/extras/mibs
MYSQL_HOME: \xampp\mysql\bin
OPENSSL_CONF: E:/xampp/apache/bin/openssl.cnf
PHP_PEAR_SYSCONF_DIR: \xampp\php
PHPRC: \xampp\php
TMP: \xampp\tmp
HTTP_HOST: thrombosisuk.kdl
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.5
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_REFERER: https://thrombosisuk.kdl/admin/core/settings/diagnostics/
HTTP_COOKIE: cmsa=1; __utma=121020109.150559340.1446645355.1447327454.1447335179.24; __utmz=121020109.1446645355.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=121020109; __utmb=121020109.60.10.1447335179; __utmt=1; PHPSESSID=6hl6m9f6vfa0lboi2p6gtje8f4
HTTP_CONNECTION: keep-alive
PATH: C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\TortoiseSVN\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Skype\Phone\;
SystemRoot: C:\windows
COMSPEC: C:\windows\system32\cmd.exe
PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR: C:\windows
SERVER_SIGNATURE: <address>Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3 Server at thrombosisuk.kdl Port 80</address>
SERVER_SOFTWARE: Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3
SERVER_NAME: thrombosisuk.kdl
SERVER_ADDR: 127.0.0.1
SERVER_PORT: 80
REMOTE_ADDR: 127.0.0.1
DOCUMENT_ROOT: E:/KDL_Projects_Open/kdl_ThrombosisUK/website/www
REQUEST_SCHEME: http
CONTEXT_DOCUMENT_ROOT: E:/KDL_Projects_Open/kdl_ThrombosisUK/website/www
SERVER_ADMIN: postmaster@localhost
SCRIPT_FILENAME: E:/KDL_Projects_Open/kdl_ThrombosisUK/website/www/admin/core/settings/diagnostics/index.php
REMOTE_PORT: 57521
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /admin/core/settings/diagnostics/?extended
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
PHP_SELF: /admin/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1447340610.12
REQUEST_TIME: 1447340610
Drew McLellan

Drew McLellan 2638 points
Perch Support

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.

Drew McLellan

Drew McLellan 2638 points
Perch Support

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