Posts by hus_hmd

    The first option is not outputting anything

    The example I shared assigns the value to a variable; it does not output it. You can echo the value:


    PHP
    1. $page_url = 'https://example.com' . perch_blog_post_field(perch_get('s'), 'postURL', true);
    2. echo $page_url;


    Or use it where you need it. So if you were to build the URL manually in PHP, you could use something like:


    PHP
    1. <?php
    2. $post_title = perch_blog_post_field(perch_get('s'), 'postTitle', true);
    3. $page_url = 'https://example.com' . perch_blog_post_field(perch_get('s'), 'postURL', true);
    4. $twitter_url = 'https://twitter.com/intent/tweet?url=' . urlencode($page_url) . '&text=' . urlencode($post_title);
    5. ?>
    6. <a href="<?= $twitter_url ?>">
    7. Share on Twitter
    8. </a>

    Hi,


    The function perch_page_url() outputs the page URL as Perch sees it. You don't technically have a page for each blog post. A blog post is its own entity, and you display them dynamically.


    One option would be to build the URL manually. You can output the postURL with perch_blog_post_field():

    PHP
    1. $page_url = 'https://example.com' . perch_blog_post_field(perch_get('s'), 'postURL', true);


    Alternatively you can use the Pipit Sharing app (on GitHub) which helps you output sharing links in both PHP and Perch templates:


    PHP
    1. <?php $postTitle = perch_blog_post_field(perch_get('s'), 'postTitle', true); ?>
    2. <a href="<?php pipit_sharing_link('twitter', ['desc' => $postTitle]); ?>" target="_blank" rel="noopener">
    3. Share on Twitter
    4. </a>


    HTML
    1. <a href="<perch:sharing id="twitter" desc="{postTitle}">" target="_blank" rel="noopener">
    2. Share on Twitter
    3. </a>

    Hi,


    Wishing you all a happy new year! Here's the annual :burd1fly: Perch review: 2019 Wrapped.


    Many thanks to all who contributed to the Perch community over the year. Special thanks to Clive Walker for keeping Perch developers connected and updated on anything Perch-related through the Perchology Newsletter and Slack group.



    Feel free to share your 2019 Perch wins on here.

    While I understand your points, until drewm releases a PHP-7.4-compatible version of Perch I don't think you have many options.


    7.4 will likely be updated on the server soon and I have little control over this process


    You should have control. Software compatibility with newer versions of programming languages/environments is not a Perch-only problem (it's not even a PHP-only problem), so a good web host would make older versions available particularly if these versions are still supported. PHP 7.3 is supported until 6 December 2020, and will receive security support until 6 December 2021. I don't expect you to keep using it until 6 December 2021, but it is safe to use it in the meantime.



    I'm not going to roll back because the previous version was very slow.


    I don't think PHP 7.3 is slow. Yes, 7.4 is probably faster, but 7.3 shouldn't cause the speed issues you are describing. Were you running 7.3 or a much older version?




    I don't think it's adequate to offer such workarounds and have them held up as "solutions".

    Of course not. I'm not suggesting rolling back to 7.3 is a permanent solution. A 7.4-compatible Perch update is certainly expected.


    However, it is also important to recognise that it is your responsibility as the developer to make sure you run the software in a compatible environment. In order to achieve this, you now know you can roll back to PHP 7.3.

    * Dangerous Undo


    Absolutely. Some of us shared our thoughts on the How often do you use Undo? thread and I think this point was brought up. So hopefully we'll see this improved in v4!



    * Control panel side navigation


    Yeah I agree; there is a few issues with the side navigation in v3. The v4 announcement mentioned they are updating the control panel UI, so hopefully we'll see something better in terms of UX.



    * Tags for perch editors, similar to member tags.

    Perch already offers customisable roles. And we can already manage which roles can create sub-pages for individual pages (from the settings tab of the page edit form). This could be a good place to have a similar setting to choose which roles can/cannot access this particular page ("may be accessed by").



    * If (user X is perch editor with tag y) then show page.

    You can detect whether the user visiting the site is logged into the Perch control panel of the site. There's no public API to perform this, but you should be able to use:

    PHP
    1. $logged_in = false;
    2. $Users = new PerchUsers;
    3. $CurrentUser = $Users->get_current_user();
    4. if (is_object($CurrentUser) && $CurrentUser->logged_in()) {
    5. $logged_in = true;
    6. }


    Having said that an easier way to manage this would be appreciated.

    I can't replicate this behaviour in Perch or Runway. Do you get any errors in the browser console when you encounter this issue? And do you have any browser extensions installed?

    Yeah thats easy to argue these days i think.


    Success is subjective. The product is stable enough even without frequent updates. That's a success. I'm still purchasing licenses. That's a success. I still get Perch development contract work on new projects from agencies (hopefully they are buying licenses and not reusing old ones). That's a success. You and me among others willingly paid for the registered developer program. That's a success.


    Perhaps It's been a slow 1-2 years for Perch in terms of development. Some may consider this the worst year for Perch, yet many are still eager to keep using it (and they are). That's a success.


    So yeah I'm still calling their 10 years run successful (not perfect).

    The low barrier of entry for less experienced devs is one of the things that sets Perch apart.


    I think this message can be clear by focusing on simplicity, ease of use (for developers and editors) and how it does not get in the way (e.g. no themes) without having to label it "little", which can be misinterpreted. Having said that, Drew and Rachel have been successfully running Perch for 10 years, which indicates the marketing suits their (perhaps primary) target audience even though I think they are underselling the product!

    I still like regular Perch and it is quite powerful despite the 'really little content management system' tagline.

    You make a good point about the tagline too – I think this probably does more harm than good.


    Absolutely. There is a blog post on dev.to titled What if WordPress.org Died? in which WordPress alternatives are discussed. The author's impression of Perch is that it is more of a content management tool rather than a system. I don't agree with this and I think Perch is a mature system, but I can't blame them for feeling this way.


    More can be done to educate developers on what Perch is capable of. Some in the Perchology slack group pointed out how the impression grabaperch.com site gives is a factor too (a little off-topic and ultimately not my place to discuss this).