Posts by davedesigner

    I have a list and detail page sorted by 7 categories. Fine all that works. :thumbup:


    I've extended this so that each category name has an css class added to give a unique colour in the category list by editing a category template and adding <perch:category id="colour" />. Fine all that works. :thumbup:


    The problem is I need to display the active category with it's colour/class inside the perch template on other items used in the detail.php page when it's selected.


    Can anyone point me in the right direction to do this?

    I've tidied up the php error by reviewing the perch:if tags.


    I'm not sure if Runway is the solution here. I run a similar site using virtually the same template and it's as fast as you like in Perch 3 with about 100 products/properties.


    However looking at a de-bug i'm getting a Template max limit hit for perch:if tags, or malformed template.


    Is there a max limit for perch:if tags in Perch 3 or generally?

    This is the dev environment on a hosting account.


    The error appears when a list and detail page is loaded with some 130 items to load. Could a bad id attribute value cause 130 items to load slowly?


    I'll check through the perch:if tags and see if I can spot something.

    I have a demo site for a client where the pages are loading unusually slowly. Looking at the Error log in the hosting I can see....


    mydemosite.co.uk [Tue Mar 26 16:16:08 2019] [error] [client 212.159.100.157:0] PHP Warning: array_key_exists(): The first argument should be either a string or an integer in /home/sites/6a/4/4d180f6999/public_html/mydemosite/cms/core/lib/PerchTemplate.class.php on line 1120


    I'm running the site with...


    • Perch: 3.1.4, PHP: 7.2.16, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 3591daad22de08524295e1bd073aceeff11e6579 $, with PDO
    • Server OS: Linux, cgi-fcgi

    Can anyone advise?

    How can I add a class to highlight a current menu item on list and detail page?


    I'd need to compare the {slug} with id="title" How do I do this?


    Code
    1. <perch:content id="title" type="text" label="Service Name" required="true" title="true" />
    2. <perch:content id="slug" for="title" type="slug" suppress="true" />



    Ah! max="1" Never knew that. Perfect. :)


    I could now use a override list with all the alternatives the client needs to display...


    Code
    1. <perch:content id="status" type="select" label="Status" type="radio" options="-,To Let (May Sell),Under Offer,Sold,Now Let" searchable="false" suppress="true" help="Override the badge status shown on property - Hidden will hide this property in the list" />

    I have two categories in a category set. The following tests if one or the other is ticked. Fine.



    However I'd like to test if both categories are ticked and output...


    TO LET (may sell)


    Can this be done using perch:categories and perch:if ?

    the 404.php shows....



    _get_content(): " style="font-family: Menlo, Inconsolata, Consolas, Courier, "Courier New", courier, fixed; font-size: 10px; color: seagreen;">[2]SELECT regionKey, regionHTML FROM perch3_content_regions WHERE regionPage='/404.php' OR regionPage='*' ORDER BY regionPage DESC
    get_value(): " style="font-family: Menlo, Inconsolata, Consolas, Courier, "Courier New", courier, fixed; font-size: 10px; color: seagreen;">[0]SELECT pageID FROM perch3_pages WHERE pagePath='/404.php' LIMIT 1
    _find_or_create_page(): " style="font-family: Menlo, Inconsolata, Consolas, Courier, "Courier New", courier, fixed; font-size: 10px; color: seagreen;">INSERT INTO perch3_pages(pagePath,pageTitle,pageNavText,pageNew,pageDepth,pageModified,pageAttributes) SELECT '/404.php' AS pagePath,'404' AS pageTitle,'404' AS pageNavText,1 AS pageNew,0 AS pageDepth,'2019-02-20 16:11:47' AS pageModified,'' AS pageAttributes FROM (SELECT 1) AS ptable WHERE ( SELECT COUNT(*) FROM perch3_pages WHERE pagePath='/404.php' )=0 LIMIT 1
    create_new_regions(): " style="font-family: Menlo, Inconsolata, Consolas, Courier, "Courier New", courier, fixed; font-size: 10px; color: seagreen;">INSERT INTO perch3_content_regions(regionKey,regionPage,regionHTML,regionOptions,pageID) SELECT 'Footer Terms ' AS regionKey,'/404.php' AS regionPage,'<!-- Undefined content: Footer Terms -->' AS regionHTML,'' AS regionOptions,'28' AS pageID FROM (SELECT 1) AS dtable WHERE ( SELECT COUNT(*) FROM perch3_content_regions WHERE regionKey='Footer Terms ' AND (regionPage='/404.php' OR regionPage='*') )=0 LIMIT 1
    _reorder_keys(): " style="font-family: Menlo, Inconsolata, Consolas, Courier, "Courier New", courier, fixed; font-size: 10px; color: seagreen;">UPDATE perch3_content_regions SET regionOrder=0 WHERE regionPage='/404.php' AND regionKey='Address' LIMIT 1
    _reorder_keys(): " style="font-family: Menlo, Inconsolata, Consolas, Courier, "Courier New", courier, fixed; font-size: 10px; color: seagreen;">UPDATE perch3_content_regions SET regionOrder=1 WHERE regionPage='/404.php' AND regionKey='Footer Terms ' LIMIT 1

    So for example looking at the 404 page (there's others) has the following php...


    <?php include('cms/runtime.php');?>
    <?php perch_content('Address'); // shared footer address ?>

    <?php perch_content('Footer Terms '); // shared footer terms ?>

    <?php echo date("Y"); ?>


    Address and Footer Terms are shared Perch content. It's usually the case this either never appears in the page list or can be deleted (with a copy replacement) which would not re-appear if the page was ever visited.


    I've never had Category, detail, 404 etc pages appear or keep re-appearing,