Posts by dosa

    I'm trying to filter some basic content. It's not working. Here's what I have - a template with one region as:

    Code
    1. <perch:content id="filter-tags" type="select" label="Category" options="available,1bed,1bed,2bed,3bed,4bed" allowempty="true" required="false" />


    And the page has this as the content_custom code:


    With that, nothing is filtering, it's just showing all the content.


    For context - these are cards with tags the content editor has chosen. I'm looking to show only the cards with the 'available' selection.

    Hi all. Trying to get the tag to use the images inside blog posts when searched. I've got the <perch:showall> tag on, but none of the ID's seem to have the image URL. How do I find this? Or if it doesn't exist, how do I create a place for an image that the search function can find and use?

    I know it's an old version. This was working for a long while and stopped recently. Nothing has changed on our end though.

    I've got some empty meta tags that look like this:

    Code
    1. <meta property="og:title" content="" />
    2. <meta name="twitter:title" content="" />

    Which is odd since the code looks like this:

    Code
    1. <meta property="og:title" content="<perch:pages id="og_title" label="Title When Shared" type="text" escape help="Used for Twitter sharing.">" />
    2. <meta name="twitter:title" content="<perch:pages id="og_title" label="Title When Shared" type="text" escape help="Used for Twitter sharing.">" />

    ...so the content is filled in, saved, but nothing is showing when rendered on the page. What am I missing?


    This is on Perch Runway 2.8.9 FYI.

    Hi all - looking for some help on some simple OG tags for SEO. I found I'm missing two items that I can't get to work.


    1. og:url -- here's my code. It's outputting nothing though.

    Code
    1. <meta property="og:url" content="<perch:pages id="url" type="hidden">">


    2. og:app_id -- something facebook wants, not sure how to implement it?

    Thanks Hussein - I'm not sure I have the full snippet correct.

    Where the attribute is "resources-cards-1", the region with the text field is "tags" and the actual filter words I want to use is "case". I added the template for displaying the content. I'm getting an error - what did I miss here? A full tag would be helpful, from open to closing tags, as I can't figure out the piece in between. Thanks for your help!!

    Sorry if that's unclear. The idea would be to use a region content - text - to filter the display of a given Collection. I have "cards" in the Collections, which is why I used that term. But it could be anything. Just wondering how to filter Collection displays from within the format I have now.

    I have an extension to the question now - can I further filter the displayed Collections using the this method show the cards, but ONLY ones with a particular element from the template?


    So in the Collection is a card with a region called "Tag" - so the content editor adds the words "case" to the tags in the card. Can I then use that specific content from that region to filter the display of the collections?


    (again, in Perch 2.8.29)


    Here's how I am displaying them now without the filter. So my question is for an example on the code with that filter in place.

    PHP
    1. <?php if (perch_page_attribute('resources-cards-1', [], true) == '1') {perch_collection('Customer Strategy Cards', ['template' => 'filter-grid-cards-low-profile-advanced.html', ]);} ?>

    @drew - I'm getting this error when implementing your solution:


    Code
    1. Fatal error
    2. : Call to undefined function perch_page_get_attribute() in
    3. /home/XXXXXX/public_html/cms/templates/pages/customer-or-partner-portal.php

    And the line it's complaining about:


    PHP
    1. <?php
    2. if (perch_page_get_attribute('cards1') == '1') {
    3. perch_collection('Resources Cards', ['template' => 'filter-advanced.html', ]);
    4. }
    5. ?>

    And in the Attributes:


    Code
    1. <!-- Set Collections -->
    2. <perch:pages id="cards1" label="Show cards 1" type="checkbox" value="1" divider-before="Collections Selector" notes-before="If this page supports Collections, select the ones you want to use here." />

    So what did I miss?

    Awesome, thanks to you both. I'll try them out and report back here.


    Unfortunately, I'm on Runway 2.something....we haven't moved everything to 3 yet for this particular site. Hopefully Drew's solution works.

    Hmm - not sure how I would use that. Here is the situation with an example, perhaps I'm approaching in wrong. I want the the CMS editor to have a choice to select from a bunch of Collections. These Collections are display on the master page, so I can't exactly add a checkbox and some options...can I?


    This example is with some way to add the show/hide class to a div on the master page using region with a bunch of checkboxes.


    PHP
    1. <div class="hide">
    2. <?php perch_collection('Cards 1', ['template' => 'card.html', ]);?>
    3. </div>
    4. <div class="show">
    5. <?php perch_collection('Cards 2', ['template' => 'card.html', ]);?>
    6. </div>
    7. <div class="show">
    8. <?php perch_collection('Cards 3', ['template' => 'card.html', ]);?>
    9. </div>