Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #985918

    Hi Guys
    I use the postslider element as a news container. The last entry will be shown. If there are no entries the slider should be invisible, but it always leaves a blank.

    <div class="slide-entry-excerpt entry-content" itemprop="text"> </div>

    The difficulty is I have set background-color and padding to class .entry-content. So if there are no entries, I have an empty coloured box.
    CSS-Style element :empty does not work, because of the blank. :blank is not supported yet.
    Then I looked at the php file found here: config-templatebuilder/avia-shortcodes/postslider/postslider.php (Line 640)

    $output .= !empty($excerpt) ? "<div class='slide-entry-excerpt entry-content' $markup>".$excerpt."</div>" : "";

    The code is absolutely correct for me and would solve my problem: the whole div including .entry-content wouldn’t be displayed. But for some reason it’s always there. I tried to replace “!empty($excerpt)” with “!isset($excerpt)” with the same result.
    That means $excerpt is never empty, right? Do you have any solution for this?

    Thank you very much in advance
    Martin

    • This topic was modified 6 years, 4 months ago by neue-zeiten.
    #986737

    Hey neue-zeiten,

    Thank you for using Enfold.

    Are you using the advance layout builder for the posts content? The $excerpt will never be empty unless the content is set to only display the title or the post has no content. Where can we see the issue? Please provide a screenshot using imgur or dropbox.

    Best regards,
    Ismael

    #986862

    Hi Ismael,

    Thanks for your reply.
    Of course I use your great layout builder. The content was set to “show title & excerpt” and title is invisible by CSS. I tried “only excerpt” too, but nothing changed. Please see the screenshot: Advanced Layout Builder - Blog Post Element
    I have only 1 blogpost which I will delete (or set to draft) if there are no news. In my understanding $excerpt should be empty if there are no blogposts. Am I doing something wrong?

    In private I provide you admin access. Backend language switched to english.
    For your understanding: page is “Home”, blog posts element is inside a color section below the slider element. Via -margin color section is over the slider.

    Best
    Martin

    #987353

    Hi,

    In my understanding $excerpt should be empty if there are no blogposts.

    The $excerpt is going to be empty when the posts has no content or excerpt and when the layout is set to display only the title. It is also empty when the advance layout builder is used because all shortcodes will be stripped from the $post->post_content. Add an excerpt manually if you’re using the advance layout builder.

    line 466

    
    $prepare_excerpt = !empty($entry->post_excerpt) ? $entry->post_excerpt : avia_backend_truncate($entry->post_content, apply_filters( 'avf_postgrid_excerpt_length' , $excerpt_length) , apply_filters( 'avf_postgrid_excerpt_delimiter' , " "), "…", true, '');
    

    line 494

    case "title":
    		$excerpt = '';
    		$title = $entry->post_title;
    		break;
    

    Best regards,
    Ismael

    #987437

    Thank you so much Ismael!
    Thread can be closed.

    Best
    Martin

    #987833

    Hi,

    You’re welcome! Please feel free to open a new thread if you need anything else. We’ll close this one now. :)

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.