Posts by dcus2018

    Working on a multi-lingual build using perch runway and within the blog app each language is separated into sections i.e EN, DE, ES etc.


    Each language sets a global variable dependant on the url and I need to filter the search results from the source relative to the blog section along with pages and collections.

    It seems using the normal 'perch_content_search' outputs all sections from the source 'PerchBlog' and is also watered down compared to pages or collections.


    Any suggestions on how best to achieve the desired result as well along with results from pages and collections?

    Since opening the ticket I have tried a couple of things with no you...

    First of all I have noticed that when I originally setup the template for the main body of the article in the blog template I was using template tag with an ID of ’text’ when I think the ID should have been ‘postDescHTML’.


    Code
    1. <perch:blog id="text" type="textarea" label="Text" html="true" size="xl" editor="redactor" editor-config="basic" order="15" required="true" divider-before="Article Content"/>
    2. <perch:blog id="postDescHTML" type="textarea" label="Text" html="true" size="xl" editor="redactor" editor-config="basic" order="15" required="true" divider-before="Article Content"/>


    I am guessing the reason for this is because built into perch is functionality that takes data from this and adds it to the database rows postDescRaw and postDescHTML as before I changed this in my local environment both columns, postDescRaw and postDescHTML where listed as NULL. So I have sorted this however it still does not work but thinking this will need to be applied to the live site at some point anyway.


    I have also tried cloning the default blog post and applying this in place of my template and also creating some test blogs however this is still not working.


    Any way as the above has still not worked I was looking at the table within phpMyAdmin and noticed the tables linked in the search ‘perch_blog_posts' and ‘perch_blog_sections’. The 2 columns I think that join the tables are ’sectionID’ and ‘blogID’ do not match up with any of the sections maybe this could have something to do with returning no results on blogs?


    Is there any thing else I could do to try and debug my issue

    0.0729 0.0022 [nil] SELECT SQL_CALC_FOUND_ROWS DISTINCT 'PerchContent_SearchHandler' AS source, MATCH(ci.itemSearch) AGAINST('a') AS score, r.regionPage AS col1, ci.itemSearch AS col2, ci.itemJSON AS col3, r.regionOptions AS col4, p.pageNavText AS col5, p.pageTitle AS col6, regionTemplate AS col7, r.regionKey AS col8 FROM perch_content_regions r, perch_content_items ci, perch_pages p WHERE r.regionID=ci.regionID AND r.regionRev=ci.itemRev AND r.pageID=p.pageID AND r.regionPage!='*' AND r.regionSearchable=1 AND (MATCH(ci.itemSearch) AGAINST('a') OR MATCH(ci.itemSearch) AGAINST('a') ) AND (r.regionPage LIKE '/en%') UNION SELECT 'PerchContent_RunwaySearch' AS source, MATCH(ci.itemSearch) AGAINST('a') AS score, c.collectionKey AS col1, ci.itemSearch AS col2, ci.itemJSON AS col3, c.collectionOptions AS col4, c.collectionKey AS col5, c.collectionKey AS col6, collectionTemplate AS col7, c.collectionKey AS col8 FROM perch_collections c, perch_collection_items ci, perch_collection_revisions cr WHERE c.collectionID=cr.collectionID AND cr.itemID=ci.itemID AND cr.itemRev=ci.itemRev AND c.collectionSearchable=1 AND cr.itemSearchable=1 AND (MATCH(ci.itemSearch) AGAINST('a') OR MATCH(ci.itemSearch) AGAINST('a') ) UNION SELECT 'PerchBlog_SearchHandler' AS source, MATCH(postTitle, postDescRaw, postTags) AGAINST('a') AS score, postTitle, postSlug, postDateTime, postDescHTML, postID, sectionSlug, "", "" FROM perch_blog_posts p, perch_blog_sections s WHERE postStatus='Published' AND postDateTime<'2019-09-06 11:06:33' AND p.sectionID=s.sectionID AND MATCH(postTitle, postDescRaw, postTags) AGAINST('a') ORDER BY score DESC LIMIT 0, 6
    0.077 0.0042 [6] SELECT SQL_CALC_FOUND_ROWS DISTINCT 'PerchContent_SearchHandler' AS source, 0-(LENGTH(r.regionPage)-LENGTH(REPLACE(r.regionPage, '/', ''))) AS score, r.regionPage AS col1, ci.itemSearch AS col2, ci.itemJSON AS col3, r.regionOptions AS col4, p.pageNavText AS col5, p.pageTitle AS col6, regionTemplate AS col7, r.regionKey AS col8 FROM perch_content_regions r, perch_content_items ci, perch_pages p WHERE r.regionID=ci.regionID AND r.regionRev=ci.itemRev AND r.pageID=p.pageID AND r.regionPage!='*' AND r.regionSearchable=1 AND ci.itemSearch REGEXP '[[:<:]]a[[:>:]]' AND (r.regionPage LIKE '/en%') UNION SELECT 'PerchContent_RunwaySearch' AS source, 1 AS score, c.collectionKey AS col1, ci.itemSearch AS col2, ci.itemJSON AS col3, c.collectionOptions AS col4, c.collectionKey AS col5, c.collectionKey AS col6, collectionTemplate AS col7, c.collectionKey AS col8 FROM perch_collections c, perch_collection_items ci, perch_collection_revisions cr WHERE c.collectionID=cr.collectionID AND cr.itemID=ci.itemID AND cr.itemRev=ci.itemRev AND c.collectionSearchable=1 AND cr.itemSearchable=1 AND ci.itemSearch REGEXP '[[:<:]]a[[:>:]]' UNION SELECT 'PerchBlog_SearchHandler' AS source, postDateTime AS score, postTitle, postSlug, postDateTime, postDescHTML, postID, sectionSlug, "", "" FROM perch_blog_posts p, perch_blog_sections s WHERE postStatus='Published' AND postDateTime<'2019-09-06 11:06:33' AND p.sectionID=s.sectionID AND ( concat(" ", postTitle, " ") REGEXP '[[:<:]]a[[:>:]]' OR concat(" ", postDescRaw, " ") REGEXP '[[:<:]]a[[:>:]]' OR concat(" ", postTags, " ") REGEXP '[[:<:]]a[[:>:]]' ) ORDER BY score ASC LIMIT 0, 6
    0.0896 0.0126 [69] SELECT FOUND_ROWS() AS `count`
    0.092 0.0024 [6] Using template: /templates/search/site-search-result.html
    0.0988 0.0067 Using translation: en.lang.search.home
    0.0988 0 Using translation: en.lang.search.cta
    0.0989 0 Using translation: en.lang.search.home
    0.0989 0 Using translation: en.lang.search.cta
    0.0989 0 Using translation: en.lang.search.cta
    0.0989 0 Using translation: en.lang.search.cta
    0.0989 0 Using translation: en.lang.search.cta
    0.099 0 Using translation: en.lang.search.cta
    0.099 0 Using translation: en.lang.search.paging.page
    0.099 0 Using translation: en.lang.search.paging.of
    0.099 0 Using translation: en.lang.search.prev
    0.0991 0 Using translation: en.lang.search.next
    0.1001 0.0011 Search term: a
    0.1002 0.0001 [nil] SELECT SQL_CALC_FOUND_ROWS DISTINCT 'PerchContent_SearchHandler' AS source, '' AS score, '' AS col1, '' AS col2, '' AS col3, '' AS col4, '' AS col5, '' AS col6, '' AS col7, '' AS col8 FROM perch_content_regions WHERE 1=0 UNION SELECT 'PerchBlog_SearchHandler' AS source, MATCH(postTitle, postDescRaw, postTags) AGAINST('a') AS score, postTitle, postSlug, postDateTime, postDescHTML, postID, sectionSlug, "", "" FROM perch_blog_posts p, perch_blog_sections s WHERE postStatus='Published' AND postDateTime<'2019-09-06 11:06:33' AND p.sectionID=s.sectionID AND MATCH(postTitle, postDescRaw, postTags) AGAINST('a') ORDER BY score DESC LIMIT 0, 10
    0.1031 0.0028 [nil] SELECT SQL_CALC_FOUND_ROWS DISTINCT 'PerchContent_SearchHandler' AS source, '' AS score, '' AS col1, '' AS col2, '' AS col3, '' AS col4, '' AS col5, '' AS col6, '' AS col7, '' AS col8 FROM perch_content_regions WHERE 1=0 UNION SELECT 'PerchBlog_SearchHandler' AS source, postDateTime AS score, postTitle, postSlug, postDateTime, postDescHTML, postID, sectionSlug, "", "" FROM perch_blog_posts p, perch_blog_sections s WHERE postStatus='Published' AND postDateTime<'2019-09-06 11:06:33' AND p.sectionID=s.sectionID AND ( concat(" ", postTitle, " ") REGEXP '[[:<:]]a[[:>:]]' OR concat(" ", postDescRaw, " ") REGEXP '[[:<:]]a[[:>:]]' OR concat(" ", postTags, " ") REGEXP '[[:<:]]a[[:>:]]' ) ORDER BY score ASC LIMIT 0, 10
    0.1046 0.0015 [0] SELECT FOUND_ROWS() AS `count`
    0.105 0.0004
    0.1053 0.0003 [1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch_content_regions WHERE regionKey='Footer Form' AND (regionPage='/en/search' OR regionPage='*')
    0.1061 0.0008 [1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch_content_index idx JOIN perch_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=68 AND idx.itemRev=14)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC

    Built out a multilingual site built on perch runway and uses a branch method to organise content.


    Having some trouble with searching the site content from the blog application. For some reason I can't get any data from the blog app even if I specify the blog independently through the source. I am pretty sure this is something I have overlooked as at one point at least I could retrieve the blog title within the results, however no I get nothing even when targeting the blog by app alone.


    The blog itself is broken down into listing for each lang variable (i.e 'en' and 'de')


    Thanks in advance




    Sorry I am not sure I follow...


    doing like this still does not seem to work here is my code now:


    PHP
    1. <?php
    2. PerchSystem::set_vars(['pagesArr'=>'Page 1|url1.html, Page 2|url2.html',]);
    3. perch_content_custom('Slide Content', []);
    4. ?>
    Code
    1. <perch:content type="select" options="<perch:content id="pagesArr">" id="links">


    Passing the string into the template works fine as I can see it print out on the template however is does not recognise passing the template tag within the template tag

    Is is possible to pass a variable into a the options part of a select field type?


    example as follows, in perch all I see in the cms as a selectable option is <perch:content id="


    php


    <?php 

    PerchSystem::set_vars(['pagesArr'=>'Page 1|url1.html, Page 2|url2.html']);

    perch_content_custom('Slide Content'); 

    ?>


    perch template

    <perch:content id="heading" type="text" label="Heading">

    <perch:content id="pages" type="select" label="Pages" options="<perch:content id="pagesArr">">