Arlima icon indicating copy to clipboard operation
Arlima copied to clipboard

Search / drag & drop to new truncates content

Open ekandreas opened this issue 9 years ago • 6 comments

When using drag & drop from search article in Arlima to a list, the content is truncated. How to avoid this feature?

ekandreas avatar Mar 19 '15 14:03 ekandreas

Content of the list or content of the post dragged over to the list?

victorjonsson avatar Mar 19 '15 15:03 victorjonsson

From the search dragged over to a list.

ekandreas avatar Mar 19 '15 16:03 ekandreas

Yes, but I need to know what content that's getting truncated. Do you mean that the content of the list (the articles) dissapears when you drop a post onto the list? Or, do you mean that the body text of the post dissapears once being dropped on a list?

victorjonsson avatar Mar 20 '15 07:03 victorjonsson

Yes, the preamble of the text from the post being dragged is truncated over 100-150 chars. So when my editors creates a new entry from a searched article in Arlima to a list the text truncates.

  1. Search an article in Arlima in your main list page.
  2. Drag the post from the search list to an Arlima list to the left.
  3. The content of the post in Arlima is truncated if its longer than 150 chars or so.

arlima-truncates

ekandreas avatar Mar 20 '15 08:03 ekandreas

Ah, yes. That is the excerpt of the post I believe. Theres probably some wp-filter that you can use. I will look into it

victorjonsson avatar Mar 20 '15 08:03 victorjonsson

There's no obvious way to modify this behaviour. Here's a quick and dirty solution.

$is_arlima_ajax = defined('DOING_AJAX') && DOING_AJAX && check_ajax_referer('arlima-nonce');
if( $is_arlima_ajax && $_REQUEST['action'] == 'arlima_query_posts' ) {
    add_filter('the_post', function($post) {
        $post->post_excerpt = $post->post_content;
        return $post;
    });
}

Maybe it would be god to let you decide whether or not to use the post excerpt or the post content via a constant in wp-config.php. I will look into it.

victorjonsson avatar Mar 20 '15 08:03 victorjonsson