Posts by hus_hmd

    Hello,


    One of the things I would love to see improve in v4 is how the Collection item URLs are managed. At the moment, we can only configure the search result/view page URL via the control panel. So apart from the search results template, we need to manage the URLs ourselves.


    One option would be to manually add it for each <a></a> link.


    HTML
    1. <a href="/team/<perch:content id="slug">"><perch:content id="name"></a>


    A single template may have the link in multiple places. A single item may be output by different templates in different contexts. So this option is not very practical. If you need to make a change, you'd have to change them all.


    Another option would be to use template includes:


    HTML
    1. <a href="<perch:template path="content/team/item_url.html">"><perch:content id="name"></a>


    This means we can manage the URL from a single template content/team/item_url.html. However, if we need to output that URL from inside a pair tag (categories, repeater, etc), we run into a scoping issue and we'd have to create another template content/team/item_url_scoped.html. This means we'd need to manage the URL in 2 templates and via the control panel for search results / view page URL.


    To overcome the scoping issue, we can use the each option to add the URL:


    PHP
    1. perch_collection('Team', [
    2. 'each' => function($item) {
    3.         // this can be managed from one place my_app_team_callback($item);
    4. $item['item_url'] = '/team/' . $item['slug'];
    5. return $item;
    6. }
    7. ]);


    However, we can't (easily) do this for related items inside perch:related tags.


    My point is, Runway does not really help with managing the URLs of Collection items. In comparison the Blog app lets you configure the post URL and makes it available to you in all contexts. So I think it would be great if the URL option in the control panel (or not) is made available in all contexts.




    The other thing I would love to see regarding the Collection item URLs is make the configuration more flexible. At the moment (for the search result/view page URL) we are very limited to what we can do. We can't format dates or use categories/relationships as far as I'm aware. Would it be possible to make the URL generation via a Perch template instead? This would give us a lot of flexibility:


    HTML
    1. <perch:if exists="category">
    2. /products/<perch:categories id="category" set="Products"><perch:if exists="perch_item_first"><perch:category id="catSlug"></perch:if></perch:categories>/<perch:content id="slug">
    3. <perch:else/>
    4. /product/<perch:content id="slug">
    5. </perch:if>

    It is not clear enough to me how you are implementing your list/detail pattern for me to suggest a solution. Are you creating a page for each project instead of relying on a single Region?


    Normally, you would create a multiple-item Region which you would use to output both a list of the items and a single item's details. The single item's view is often determined by the URL e.g. /projects.php?s=my-project-slug or /projects/my-project-slug.



    So you would typically rely on the slug in the URL. Assuming you're using /projects.php?s=my-project-slug, you'd get the slug with perch_get('s'):




    Resources you may want to refer to:


    It's a "news" article. I always publish news by this way. After publishing I pressed the "delete" button. The article "item1" dissapeard in perch, but the article is still online. Maybe because I set a checkmark on "store draft". But I can't find the "draft" corner in perch.

    Is the article a blog post you added with the Blog app? Or is it an item in a multiple-item Region? Or is it an item in a Runway Collection?

    Out of the supported gateways by Perch Shop, which ones do not require a driver update?


    PayPal hosts the payment pages for PayPal Express so they may update the payment flow. The following quote is regarding PayPal Pro hosted, but I think this may be true for PayPal Express too:


    PayPal Pro hosted

    With our hosted solution, when a customer pays, a payment page either opens in a separate frame or the customer is redirected. If you use our hosted solution, then we manage your payment process at checkout. We will automatically upgrade the payment process, so you don’t need to worry.


    If at least PayPal Express meets the SCA requirements, perhaps it can be used (for a temporary period at least) until Stripe/Braintree Omnipay drivers are updated? It's not ideal to have to make the change if your clients are already using something else, but at least they'd continue receiving payments.

    Hi,


    You can use the use keyword: