Posts by granttransition

    I’m getting very confused (very easy to achieve!) by categories. I have a page which is displaying a category set, this includes links to the contained categories.


    Example, cat set strengthening, this set includes categories such as, Neck, Elbow etc…


    When someone clicks on Neck, I want a page to display all the items that are categorised as Neck. If they click on Elbow, everything categorised as Elbow appears. etc.


    Here is where I am at currently, tried various methods, such as trying to filter, sort and so on without success.


    PHP: Current Template
    1. $template    =    'strengthening/list.html';
    2. perch_collection('Strengthening', [
    3. 'template' => $template,
    4. 'category' => array('strengthening/neck', 'strengthening/shoulder-girdle', 'strengthening/elbow', 'strengthening/wrist-and-hand', 'strengthening/thoracic-spine', 'strengthening/lumber-spine', 'strengthening/gluteals', 'strengthening/hip', 'strengthening/knee', 'strengthening/ankle', 'strengthening/foot', 'strengthening/functional-mobility'),
    5. 'filter' => 'catSlug',
    6. 'match' => 'eq',
    7. ]);


    This template, displays all my categories regardless of filtering and sorting. Hence I think this my issue has something to do with category => array, but what should be in its place?


    Thanks in advance

    I seem to be having issues with a site sending emails. Upon testing under Settings / Email. If I try to send a test, the site times out with a 504 Gateway Time-out error and the following is logged in the server log.

    Code: Server Log
    1. Error 500 POST /perch/core/settings/email/ HTTP/1.0 https://www.###.gov.uk/perch/core/settings/email/ Apache SSL/TLS access
    2. Warning mod_fcgid: read data timeout in 60 seconds, referer: https://www.###.gov.uk/perch/core/settings/email/ Apache error
    3. Error Premature end of script headers: index.php, referer: https://www.###.gov.uk/perch/core/settings/email/ Apache error
    4. Error 24612#0: *204846 upstream timed out (110: Connection timed out) while reading response header from upstream nginx error

    I also commented out their SMTP settings and tried again. This results in Runway telling me "Invalid address: (setFrom) PERCH_EMAIL_FROM". And the server logs:

    Code: Server Log
    1. Warning mod_fcgid: stderr: PHP Warning: Use of undefined constant PERCH_EMAIL_FROM_NAME - assumed 'PERCH_EMAIL_FROM_NAME' (this will throw an Error in a future version of PHP) in /var/www/vhosts/###.gov.uk/httpdocs/public/perch/core/settings/modes/email.pre.php on line 27, referer: https://www.###.gov.uk/perch/core/settings/email/ Apache error
    2. Warning mod_fcgid: stderr: PHP Warning: Use of undefined constant PERCH_EMAIL_FROM - assumed 'PERCH_EMAIL_FROM' (this will throw an Error in a future version of PHP) in /var/www/vhosts/###.gov.uk/httpdocs/public/perch/core/settings/modes/email.pre.php on line 28, referer: https://www.###.gov.uk/perch/core/settings/email/ Apache error

    As the error is referencing core files I wondered if something changed upon my recent update to Perch Runway 3.1.4?

    Hi Ryan,


    Sorry yes to clarify.


    From Perch Forms Installation guide. "To get started you need to create and successfully submit a form. You will then be able to configure that form instance in the Control Panel".


    I have created the form, filled and pressed send to try and submit the form to Control Panel. Control Panel isn't displaying the form after I have tried to initiate it on live.


    Works fine on local though?

    I have a booking enquiry from at https://www.stokesleytowncounc….uk/town-hall/how-to-book which will not register on the Live Server. However, registers fine on local host. Local is running PHP 7.2.10 and Live is running 7.2.15.

    Some help to work out why would be much appreciated. Many thanks :/

    Hi,


    I'm looking for some help with Template Comments, specifically how I can use them to make my rendered code look prettier. I know this is a bit trivial, however, I have noticed an effect of SEO, plus if any other devs look at the code. I don't want them thinking I didn't even try :P


    My Example is this.


    Screenshot%202019-02-19%2011.23.36.png?dl=0


    Line 238 has a <ul> butted up against the closing </ul>. And then there are gaps on lines 240 and 242. And finally a closing </div> which should be on the next line down. And this is as good as I can get it currently. Gaps always appear when using <perch:if>.


    The above is from my Footer which pulls in a template for these social links. Here is my code.


    I have had some successes using this method, however, this isn't working for the above. Is there a specific way I should be using Template Comments to remove gaps, and line up code :?:

    I found my switch in page-head.php had an error.


    PHP: Working code
    1. switch(perch_layout_var('meta', true)) {
    2. case 'locations':
    3. perch_collection('Locations', [
    4. 'template' => 'locations/meta_head.html',
    5. 'filter' => 'slug',
    6. 'match' => 'eq',
    7. 'value' => perch_get('s'),
    8. ]);
    9. break;

    I am getting a PHP Notice: Undefined index: title on line 13 of the following code.


    It seems unhappy $page_title = $locations[0]['title'];. But I can't figure out why?


    :/


    The Locations Collection this refers to has <perch:content id="title" type="text" label="Title / Heading" required title> in the item.html file. I thought it might not like the way I've written the title id. However it doesn't seem to make a difference?


    Thanks in advance

    Thanks Hussein,


    I've been playing with this and I'm little stuck!


    Here is what I have.


    HTML: /content/location/location_list.html
    1. <div class="cell-sm-9 cell-md-6 cell-lg-3">
    2. <div class="thumbnail-classic unit unit-sm-horizontal unit-md-vertical">
    3. <div class="thumbnail-classic-caption unit-body">
    4. <h6 class="thumbnail-classic-title"><perch:content id="title" type="text" label="Location title" required></h6>
    5. <hr class="divider divider-default divider-sm">
    6. <p class="thumbnail-classic-text"><perch:content id="sectionLeader" type="text" label="Section leader text"></p>
    7. </div>
    8. </div>
    9. </div>

    This results in neither template displaying on the location page?

    I'm not sure this is possible and there might be a better way to implement. This is a Perch project (not Runway).


    My client has a number of locations, let's call them 1 to 7.


    When someone is viewing location 1, there needs to be a bar displaying locations 2 to 7. When on location 2, the bar needs to display 1, 3, 4, 5, 6 and 7 etc.


    In the absence of collections. I was thinking I could have a template which lists all the locations (other_locations.html) and have that as a shared region. Hence the client only has to input the data once.


    In a separate template (display_locations.html), I was thinking I could use checkboxes for each location. Hence when on location 1, the client could click the locations 2 - 7 to display them. These would refer to perch:if exists which surround the Locations.


    I made a test template just to show both templates in a single working template. And that looks like this:


    It is possible in the location.php master page template to somehow, allow other_locations.html to be a shared region, and then pass it into display_locations.html


    Hope this make sense :/

    I have three templates in my layout, all of which use `<perch:if exists=>` statements. They all refer to my `profile.html` template, which gives the client one place to enter their relevant company details. If none are entered, then the item doesn't display.


    The three templates are as follow:

    So is there a limit to amount the of `if:tags`I can have? Or is there something wrong with my code?