Git Product home page Git Product logo

Comments (8)

bobbingwide avatar bobbingwide commented on June 25, 2024

While trying to create a simple test for the problem I accidentally moved a block from a dynamically displayed post out of the Post content block. This shouldn't be possible. Here the WordPress block came from the post entitled WordPress.
I was trying to move the Post content block into the first column.

image

from fizzie.

bobbingwide avatar bobbingwide commented on June 25, 2024

Here's the result where page Aaf uses a query to display the last post in two columns with Post content on the left and Post excerpt on the right. The Post content looks more like that which I'd expect the Post excerpt should look.
The Post excerpt should display the more link.

image

In the block editor the display is more confusing.
image

from fizzie.

bobbingwide avatar bobbingwide commented on June 25, 2024

The content of page Aaf is

<!-- wp:paragraph -->
<p>aaf's post excerpt before more.</p>
<!-- /wp:paragraph -->

<!-- wp:query {"queryId":1,"query":{"perPage":1,"pages":1,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"title","author":"","search":"","exclude":[1346],"sticky":""},"className":"border"} -->
<!-- wp:query-loop -->
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:heading {"level":3} -->
<h3>Post content</h3>
<!-- /wp:heading -->

<!-- wp:post-content /--></div>
<!-- /wp:column -->

<!-- wp:column -->
<div class="wp-block-column"><!-- wp:heading {"level":3} -->
<h3>Post excerpt</h3>
<!-- /wp:heading -->

<!-- wp:post-excerpt {"wordCount":43,"showMoreOnNewLine":false} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
<!-- /wp:query-loop -->
<!-- /wp:query -->

<!-- wp:more -->
<!--more-->
<!-- /wp:more -->

<!-- wp:paragraph -->
<p>aaf's post content after more.</p>
<!-- /wp:paragraph -->

The content of the post with the highest title ( Zzz ) is

<!-- wp:paragraph -->
<p>Zzz - post excerpt before more.</p>
<!-- /wp:paragraph -->

<!-- wp:separator -->
<hr class="wp-block-separator"/>
<!-- /wp:separator -->

<!-- wp:more -->
<!--more-->
<!-- /wp:more -->

<!-- wp:paragraph -->
<p>Zzz - start of post content after more. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This post was created to test post content &amp; post excerpt extraction for the <code>core/post-content</code> and <code>core/post-excerpt</code> blocks when they're inner blocks of the <code>core/query</code> <code>core/query-loop</code> constructs. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>See <a href="https://s.b/wp56/aaf/">page Aaf</a>.</p>
<!-- /wp:paragraph -->

from fizzie.

bobbingwide avatar bobbingwide commented on June 25, 2024

Expected result - front end

image

Expected result - editor

Post content

The More block should not be a problem

Post excerpt

Should be processed the same as on the front end.
That may involve:

  • using the post_excerpt field, if set

or

  • expanding shortcodes
  • stopping at the more tag
  • NOT stripping HTML tags
  • displaying the more link as specified in the block

from fizzie.

bobbingwide avatar bobbingwide commented on June 25, 2024

I've been retesting this using the original data for #27 and I'm still getting strange results.

The content of post B is

<!-- wp:paragraph -->
<p>B's normal excerpt</p>
<!-- /wp:paragraph -->

<!-- wp:more -->
<!--more-->
<!-- /wp:more -->

<!-- wp:paragraph -->
<p> [bw_wpadmin]</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>B's normal content</p>
<!-- /wp:paragraph -->

When displaying the post excerpt for B I'd expect to see "B's normal excerpt"
For the post content I'd expect to see all of the above.

What I'm actually getting is just the post content, there's no post excerpt.

<div class="entry-content wp-block-post-content is-layout-flow">
<p>B’s normal excerpt</p>
<p> <a href="https://s.b/wp55/tt1/b/#more-92" class="more-link"><span aria-label="Continue reading B">(more…)</span></a></p>
</div>

Perhaps it's my understanding of what the more block is supposed to do!
When there isn't a more block it seems OK.
I'll have to check the query loop again.

from fizzie.

bobbingwide avatar bobbingwide commented on June 25, 2024

I'll have to check the query loop again.

OK, the reason we don't see post excerpt is because it's not included in the post-template.

I should be attempting to reproduce the problem with page Aaf and post Zzz.
... and then understand / believe that what I got told in Nov 2020 is that what I'm seeing is what was intended!

Environment now is s.b/wp URL: https://s.b/wp/aaf/

  • When there isn't a more block in Zzz then the post content and post excerpt are displayed the same on the front end.

  • When there's a hand cranked excerpt then we see the hand cranked excerpt.

  • When there's a more block then the post content is truncated at the more.

  • When the more block "Hide the excerpt on the full content page" is toggled on then

    • the post content in the query loop shows the excerpt
    • the content before the more is not displayed when when viewing the post

These were the results testing with WordPress 6.0.1 and Gutenberg 12.3.0
I'd better repeat the tests with the latest versions: WordPress 6.2-RC1 and Gutenberg 15.3.1

from fizzie.

bobbingwide avatar bobbingwide commented on June 25, 2024

With WordPress 6.2-RC1 and Gutenberg 15.3.1 the results are different.

  • DIFFERENT When there isn't a more block in Zzz then the post content and post excerpt contain the same data but the excerpt has lost all the HTML formatting.
    image

  • SAME When there's a hand cranked excerpt we see the hand cranked excerpt

  • SAME When there's a more block then the post content is truncated at the more. See the first screen capture in #43 (comment)

  • When the more block "Hide the excerpt on the full content page" is toggled on then

    • SAME the post content in the query loop shows the excerpt
    • SAME the content before the more is not displayed when when viewing the post

The Expected result - front end that I documented on 23 Nov 2020 at 10:54 pm reflects the results I used to get using the [bw_pages] shortcode displaying post_content (C) or post_excerpt (E).

#43 (comment)

from fizzie.

bobbingwide avatar bobbingwide commented on June 25, 2024

I've reproduced the Expected result - front end with the page Aaf 2023.
This page uses the [bw_field] shortcode to display post_content and post_excerpt directly from the post's fields. These have the green background. Below these are the output of the blocks.

image

Note that what's displayed for the post content block is different in the editor.
image

What I see in the editor is what I want in the front end!

I suppose I could override the behaviour of the post-content and post-excerpt blocks to achieve this. I won't close this issue yet.

from fizzie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.