Comments (8)
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.
from fizzie.
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.
In the block editor the display is more confusing.
from fizzie.
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 & 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.
Expected result - front end
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.
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.
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.
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.
-
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).
from fizzie.
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.
Note that what's displayed for the post content block is different in the editor.
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)
- Update Fizzie to cater for changes in Gutenberg 10.7.1 HOT 5
- Adjust Fizzie so that it can be used as a parent theme for Wizzie HOT 3
- Update Fizzie to cater for changes in Gutenberg 10.9.0 HOT 3
- Replace [post-edit] shortcode by sb-post-edit-block HOT 1
- Update Fizzie to cater for changes in Gutenberg 12.1.0 / 12.2.0 / 12.3.0 / 12.4.0 HOT 15
- Replace `core/query-loop` with `core/post-template` to avoid Warnings in the Site Editor HOT 1
- Update Navigation menus for Gutenberg 12.3.0 / WordPress 5.9 HOT 2
- Extract logic that enables text editing of `wp_template`, `wp_template_part` and `wp_navigation` to a separate plugin HOT 5
- Add Comments template part / pattern HOT 1
- post-comments almost illegible in blocks.wp.a2z HOT 1
- Add HTML patterns to be loaded by oik-patterns HOT 2
- Enable child themes: Remove `"theme":"fizzie"` attributes from template parts HOT 1
- Update Fizzie to cater for changes in Gutenberg 12.9.0 HOT 2
- Warning: Undefined array key "id" in navigation block HOT 1
- Fatal errror: Uncaught TypeError: array_key_exists() HOT 3
- Display post content full width for single oik-themes HOT 1
- Test with WordPress 6.2, Gutenberg 15.3.1 and update for 2023 HOT 4
- Uncaught TypeError invoking Site Editor HOT 1
- Support PHP 8.1 and PHP 8.1
- Various template parts not found messages HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fizzie.