Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search / drag & drop to new truncates content #95

Open
ekandreas opened this issue Mar 19, 2015 · 6 comments
Open

Search / drag & drop to new truncates content #95

ekandreas opened this issue Mar 19, 2015 · 6 comments

Comments

@ekandreas
Copy link
Contributor

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

@victorjonsson
Copy link
Owner

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

@ekandreas
Copy link
Contributor Author

From the search dragged over to a list.

@victorjonsson
Copy link
Owner

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?

@ekandreas
Copy link
Contributor Author

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

@victorjonsson
Copy link
Owner

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants