Posts by Glen

    Hi everyone


    I’m looking to connect an external API to a standard Perch site but I have never done it before so I was wondering if anyone had and pointers or tips.


    I am wanting to display the local tide times and there is an API available that provides the data for which I’m guessing I can then somehow manipulate and style?


    Many thanks for any help :thumbup:


    Glen

    This is currently possible by using perch_forms at the same time.


    On the Perch comments form you can also post to the Perch forms addon so that when a comment gets submitted, it also posts the data to perch_forms where you can then set up an autoresponder in the form options to say a comment has been left and requires reviewing.


    So, on your comments form template, you would have...


    Code
    1. <perch:form id="comment" method="post" app="perch_comments perch_forms">

    This is currently possible by using perch_forms at the same time.


    On the Perch comments form you can also post to the Perch forms addon so that when a comment gets submitted, it also posts the data to perch_forms where you can then set up an autoresponder in the form options to say a comment has been left and requires reviewing.


    So, on your comments form template, you would have...


    Code
    1. <perch:form id="comment" method="post" app="perch_comments perch_forms">

    Hi Everyone.


    I have a website which uses the comments app so visitors can leave... comments!


    One page now has over 50 comments so I am looking at adding in a button every 10 comments which load the next 10 comments, and so on. Lazy load style


    The site is using Bootstrap 4.6 so I tried using collapse but that only half works. I was wondering if anyone had tried something similar using Perch's pagination tags. The only issue I see is that next_url wants to link to a new page URL when what I am trying to achieve is to display the next set of comments directly underneath on the same page.


    Any pointers would be gratefully received.


    Many thanks


    Glen

    Hi everyone


    I have just launched a new community project, where I am teaming up with a few local businesses and organisations, and have just launched Hunstanton Webcams at https://hunstanton.webcam


    The site uses standard Perch with the forms and comments app. Thank you to Byron Fitzgerald for his help in this forum.


    The aim of the project is to install webcams in key locations around the town of Hunstanton, on the North-West Norfolk coast, so that those that are stuck at home can virtually visit the coast. There is currently only one webcam live on the site but we have a further 3 lined up to be installed.


    Happy viewing


    Glen

    Hi everyone,


    Me again (sorry!).


    Quick question, is there a way to get PerchSystem::redirect('http://example.com/'); to open a new window / tab instead of redirecting in the current window / tab? (just like target="_blank" does).


    Many thanks


    Glen

    Hi Everyone


    I am using <a href="<perch:content id="_page">"> on a template which is being used via a perch_content_custom in order to link to the page that the original content has come from.


    Does anyone know how I can hide the page extension as it currently links to www.url.com/page.php and not www.url.com/page?


    I'm using standard Perch so it is linking to a physical page and I have the .htaccess rewriting etc successfully working too.


    Many thanks


    Glen

    Hi Byron Fitzgerald


    Many thanks for that, the comments now appear.


    Unfortunately however the "3 days ago" line does not. Looking at <perch:showall> the perch ID postAgo is not being passed into the template. So sorry to keep asking but would you know what's missing?


    Many thanks


    Glen

    Hi Byron Fitzgerald - wow thank you :)


    Unfortunately, nothing is being displayed, I ran a debug which showed an array error but after fixing that nothing still displays. The updated code I am using is as follows...



    Time ago code...



    Comments code...




    Thank you so much :thumbup:

    This seems odd to me. Normally layouts are string literals pointing to a html file in templates.





    Code
    1. perch_layout('time_ago', array(
    2. 'newsDateTime' => date("j M Y", strtotime($newsDateTime)),
    3. ));
    Code
    1. perch_layout('layouts/_root_comment_date.html');

    Hi ian Hobbs


    You can pass variables into layouts just like you can with other regions... https://docs.grabaperch.com/pe…nd-nav/layouts/variables/


    As mentioned, it works perfectly well on another site using the blog addon, for some reason I can’t get it to work on this site using the comments addon?


    Glen

    HI Byron Fitzgerald, sorry me again!


    I have just run <perch:showall> and it is showing that the id postAgo isn't getting passed into the template.


    As mentioned, I have copied everything over from the other site so I'm not sure why this would be.


    Many thanks - it is much appreciated.


    Glen

    Hi Byron Fitzgerald - I hope you had a great Christmas & News Year?


    I was wondering if you could help me once again?


    I have copied over the timeAgo code to another website but this time into the perch_comments addon. I have copied everything across like for like but nothing is being displayed, would you mind please having a quick look to see what I've missed?...




    ...thank you sooooo much for your help. :)


    Glen

    Hi Perch Community!


    I am currently building a site for a local magazine and we would like to have a page with all the previous issues on - all 15 years worth!


    I'm adding the previous issues into a collection so I can also include them around the rest of the site too, specially the latest issue. But for the previous issues page I was wondering if there was a way to dynamically divided up the issues by year using just one perch_collection() rather than having one for each year, and then of course having to remember to add a new one each year.


    So far I have...

    ...etc.


    Many thanks for your help


    Glen

    Thanks Byron Fitzgerald for your reply.


    I have now got the php working but I still can't seem to pull in the blog post date from Perch. The output I get is "1 Jan 1970" but if I manually include a date it works perfectly....


    pages/home.php...



    layouts/global/time_ago.php...


    templates/blog/home_main_headlines.html...


    Any help to point me in the right direction would be must apricated.


    Glen