Forum Replies Created

Viewing 15 replies - 61 through 75 (of 165 total)
  • Plugin Author Chester McLaughlin

    (@chetmac)

    If you send me your contact info via https://chetmac.com/contact/ I’ll get back to you with a Screenshare link so we can quickly walk through the issues together.

    Plugin Author Chester McLaughlin

    (@chetmac)

    WP Engine is most likely the cause of the problem.

    They are NOT very transparent with exactly how their caching works which makes it hard to troubleshoot. Try disabling Object Caching and see if that fixes anything.

    Plugin Author Chester McLaughlin

    (@chetmac)

    When doing a recent project with Airpress and ACF, I ran into the issue described here:

    https://stackoverflow.com/questions/36181023/acf-fields-value-not-available-until-saving-post-manually

    Might be applicable to your situation…

    Plugin Author Chester McLaughlin

    (@chetmac)

    Do you happen to use the Advanced Custom Fields plugin by any chance?

    Plugin Author Chester McLaughlin

    (@chetmac)

    Are you using a Airpress VirtualPost or VirtualField configuration on this page?

    Plugin Author Chester McLaughlin

    (@chetmac)

    Perhaps this snippet will help:

    
    <?php
    
    $query = new AirpressQuery();
    $query->setConfig("Academic");
    $query->table("Feeds")->view("Grid");
    $query->addFilter("{Source}='Film Journals'");
    
    $events = new AirpressCollection($query);
    
    $field = "Author";
    $table = "Authors";
    
    $events->populateRelatedField($field,$table);
    
    ?>
    
    <div>
    	<ul>
    	<?php 
    	foreach ($events as $pubitems) {
      		echo '<li>' . '<a href=' . $pubitems["Link"] . '</a>' . $pubitems["Title"] . '</a>' . ": " . $pubitems["Author"][0]["Name"] . '</li>';
    	}
    	?>
    	</ul>
    </div>
    
    Plugin Author Chester McLaughlin

    (@chetmac)

    It would appear that you’re attempting to use VirtualPosts on the “home page” of your WordPress site. That isn’t currently supported. you’ll notice in your debug output that your slug is empty because you’re matching the entire URL and yet you’re only access “/” …

    If you need to load Airtable data on your homepage, you’ll need to dive into the PHP and add something like this to your theme functions file:

    
    <?php
    
    function my_airpress_homepage_query( $atts ){
    	global $post;
    
    	if ( is_home() ){
    
    		$my_airpress_connection_id_or_name = 0;
    
    		$query = new AirpressQuery("My Table Name", $my_airpress_connection_id_or_name);
    		
    		// Optionally specify View
    		$query->view("My View");
    
    		// Optionally specify Fields (will only return these fields)
    		$query->fields(["Name","Gem Type","Jewel Type","Quick Pics","Good Pics","Certificates"]);
    
    		// Optionally provide a filterByFormula, this one ensures Slug is NOT empty
    		$query->filterByFormula("NOT({Slug},'')");
    
    		// This will ensure that you can use shortcodes on the homepage still
    		// such as [apr field="Slug"]
    		$post->AirpressCollection = new AirpressCollection($query);
    	}
    
    }
    
    add_action("the_post", "my_airpress_homepage_query");
    
    ?>
    
    Plugin Author Chester McLaughlin

    (@chetmac)

    Glad you got it working! Thanks for posting the snippet here to benefit others.

    Plugin Author Chester McLaughlin

    (@chetmac)

    I’m going to mark this as resolved as it does not appear to have anything to do with the Airpress plugin. It must be something at the server level between your host and Airtable.

    Could be some security certificate issue with whatever PHP is using to download the remote image… but that seems unlikely as a regular img src wasn’t working either. You could always try the import plugin again using https instead of https. If that works you can talk to your host about the issue.

    Plugin Author Chester McLaughlin

    (@chetmac)

    This is truly strange! Are you using the loop shortcode? What is your VirtualFields configuration? Can you post the shortcodes or php you’re using to generate this output?

    One thing to try is using VirtualPosts and not VirtualFields.

    Create two regular WordPress Pages called “AIRPRESS: Mentors Lists” and “AIRPRESS: Mentors Item”. these will be the “templates” for displaying/rendering your data.

    The first page (mentors list) is a little confusing as you’re making a template that will be used with exactly 1 url—so why use VirtualPosts for that? The reason is because VirtualPosts allow you to use a FilterByFormula to retrieve your list of mentors.

    Create two VirtualPost configurations, one utilizing each template.

    The VirtualPost configuration for the mentor list should look something like this: https://imgur.com/k9et3Cf

    There is no FilterByFormula so it will return all records from the Mentors table.

    The VirtualPost configuration for the mentor item should look something like this: https://imgur.com/cyOhCe7

    If that’s unhelpful, hit me up using the contact form at https://chetmac.com and we’ll schedule a screenshare meeting to debug.

    Plugin Author Chester McLaughlin

    (@chetmac)

    I don’t see anything strange at a glance…

    And the image does appear to load here on the forum, so I don’t know why it wouldn’t load on your site—unless you had some javascript that was attempting to do lazy-loading or something.

    Plugin Author Chester McLaughlin

    (@chetmac)

    Can you view the HTML (page source) of the page and post either a screencapture or copy/paste the source of image that isn’t loading?

    Something like:

    <img src="https://dl.airtable.com/ypC6h0zsRWia4D6Kx5m5_common-ground.jpg">

    Also, if you’re able to posts screenshot of the backend admin/editor (shortcode?) that is generating the image that would be helpful also.

    My gut says that you’re using a Airpress shortcode inside another shortcode (or page editor) that doesn’t actually render the short code. “Nested” shortcodes don’t work unless specifically coded to do so by the plugin author. So if you wrap a Airpress shortcode inside another shortcode that doesn’t support nesting, it simply won’t be executed.

    Plugin Author Chester McLaughlin

    (@chetmac)

    Can you post a screenshot or code snippet showing what you’re currently doing and/or what you’re trying to accomplish?

    I doubt this is an issue with “pre-loading” anything, rather it’s probably an issue with nested shortcodes or some other WordPress + Shortcode behavior.

    Also, if you have a working example of the map *without* Airpress (using a static address/location) I might be able to provide more insight into how to integrate with Airpress.

    Plugin Author Chester McLaughlin

    (@chetmac)

    The apr shortcode must be evaluated by WordPress in order to produce anything other than the string you provide. For example: $x = "[apr field='count']"; is merely a string—nothing more, nothing less.

    However, if I do this:

    $x = do_shortcode("[apr field='count']")

    it will be actually ‘execute’ the shortcode apr with your parameters field="count".

    If you’re working in PHP directly, it’s roughly equivalent to:

    $x = $post->AirpressCollection[0]['count'];

    In reality it’s actually doing this in order to accommodate values from multiple records:

    
    $x = implode("\n", array_map(function ($record) { return $record['count']; }, $post->AirpressCollection) );
    
    Plugin Author Chester McLaughlin

    (@chetmac)

    I think you’re wanting to use the apr_loop:

    
    [apr_loop field="Features"]
    <a href="/category/{{Name}}">{{Name}}</a> OR
    <a href="/category/[apr field='Name']">[apr field='Name']</a>
    [/apr_loop]
    

    And if this is already in a loop, you can use up to 10 nested loops like:

    
    [apr_populate field="Features" relatedTo="Features"]
    
    This is a page with a list of items. Let's list those items!
    
    [apr_loop]
    
    This is a record with some related items in the 'Features' field. Let's loop those features!
    
      [apr_loop1 field="Features"]
        <a href="/category/{{Name}}">{{Name}}</a> OR
        <a href="/category/[apr field='Name']">[apr field='Name']</a>
      [/apr_loop1]
    
    [/apr_loop]
    

    Let me know!

Viewing 15 replies - 61 through 75 (of 165 total)