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

Display Posts as Inline List #25505

Open
Tracked by #41405
iamtakashi opened this issue Sep 21, 2020 · 9 comments
Open
Tracked by #41405

Display Posts as Inline List #25505

iamtakashi opened this issue Sep 21, 2020 · 9 comments
Labels
[Block] Query Loop Affects the Query Loop Block Needs Design Needs design efforts. [Type] Discussion For issues that are high-level and not yet ready to implement.

Comments

@iamtakashi
Copy link

Related: #25501 #25502 #25503

This particular example is a kind of "out-there" style, but we see posts displayed as an inline list.

Frame 64

To be clear, I'm not advocating all these examples as something the core Gutenberg needs to support 😄 It might make sense to be a third-party plugin. I just wanted to surface those examples to raise awareness of various use cases that the user might want to achieve with a query.

@karmatosed karmatosed added Needs Design Feedback Needs general design feedback. Needs Design Needs design efforts. and removed Needs Design Feedback Needs general design feedback. labels Sep 23, 2020
@iamtakashi iamtakashi mentioned this issue Sep 24, 2020
8 tasks
@mtias
Copy link
Member

mtias commented Sep 25, 2020

I think what's interesting here is seeing how easy it'd be for a third party block to author this output using as many tools from @wordpress as possible. For example, it seems the query should be managed by the main Query block, but perhaps the Loop block output is switched entirely to do this inline rendering.

@mtias mtias added [Block] Query Loop Affects the Query Loop Block [Type] Discussion For issues that are high-level and not yet ready to implement. labels Sep 25, 2020
@mtias
Copy link
Member

mtias commented Apr 16, 2021

@kjellr do you think this is achievable now with patterns?

@kjellr
Copy link
Contributor

kjellr commented Apr 16, 2021

@kjellr do you think this is achievable now with patterns?

I love a Friday challenge! The answer is yes and no.

It is not possible natively yet. These are the blockers there:

On the other hand, this sort of style is possible if you combine the pattern with block styles:

Query-Block

This required some pretty aggressive CSS though. Blocks in the editor come with a lot of extra divs that serve various purposes, and I had to force those all to be display: inline. It mostly worked, but it didn't work on appenders, so I ended up hiding those. I also had to force some specific margins on each block. The code's over here in case anyone wants to give it a look: PHP / CSS.

Using block styles is interesting as a proof-of-concept, but it obviously bars this from working in the upcoming Pattern Library. A native solution would be better. We should definitely give the featured image block its own size controls, and I think some sort of inline solution is worth including for the scenario outlined in #26899. Once we figure those out, I think this should work without any extra hacking.

@mtias
Copy link
Member

mtias commented Apr 19, 2021

It seems like inner-blocks should have a display option for "inline". Though I have no clue how much mayhem that may unleash on the block wrappers :) cc @youknowriad @ellatrix

@youknowriad
Copy link
Contributor

This definitely seems like another "type" for the layout prop of "InnerBlocks"

@ellatrix
Copy link
Member

Why does inner blocks have to be concerned with "inline"? Inner blocks itself doesn't render any divs, it's up to the block to style all this.

@mkaz
Copy link
Member

mkaz commented Apr 21, 2021

The container block needs to be set to inline so all the display:block elements inside it can flow.

I'm not sure it should be done with InnerBlocks, my thought is it should be a layout prop for the Group block, (or maybe a variant). The issue I see with InnerBlocks is that each block will be required to implement to set that prop, a user can't insert an InnerBlock when building a block theme.

Here is the case I'm thinking: trying to put an icon in front of the Post Categories block, we have an icon block and the category block, I'd like to piece them together as two inline blocks together.

Here's an example with the post meta from TwentyNineteen:

image

@mkaz
Copy link
Member

mkaz commented Apr 21, 2021

As in anything, there are ticket precedence, same inline issues raised in #26899 and #24473

@jasmussen
Copy link
Contributor

I created #31418 to suggest dimension controls on the Featured Image block. While it wouldn't necessarily enable the inline display discussed here, it would likely complement it nicely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block Needs Design Needs design efforts. [Type] Discussion For issues that are high-level and not yet ready to implement.
Projects
None yet
Development

No branches or pull requests

8 participants