-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fixed Position Header and Footer Template Parts #30121
Comments
In my experience, |
I temporarily created a custom block style for a sticky header in a theme, but I had to make it available for all template parts and not just the header 😬 #31171 |
Just assigning myself to this one as I'd like to have a go at coming up with a solution for it. Nothing to see yet, but I'll be hacking away over in #38039 (I thought I'd try |
Update: while I've made a start on exploring this issue in #38039, I'm switching over to focusing on helping move forward the styles engine (#38167) in the shorter-term. My aim is to get back to this fixed/sticky position support once the styles engine has progressed a little further. (If anyone else wants to pick up this issue and explore it, don't let that stop you, though!) |
@critterverse another thing I'd like to see us address is how we present these things in the list view. For example, at the root level of the document, fixed / absolute positioned elements could be grouped as its own tree. This would allow easier management of non-flowing elements. Not sure how we should represent absolutely positioned elements within another container down the tree. |
Just came across this and chiming in to say how this would be really neat to have. Some aspects worth considering for this functionality would be:
|
Definitely +1 on this. All of the other major CMS platforms have this and it would really help us designer / developers to stay competitive :) |
This comment was marked as resolved.
This comment was marked as resolved.
Relative can probably be default, right? It doesn't have to translate 1:1 to CSS. As far as absolute, I think it could be a bridge to cross when we get there: the free-form layout use cases that come to mind seem like they might require some separate design thoughts altogether. |
It really depends on whether we want to support the full expression of CSS. There may be situations where you want child blocks to be positioned absolutely relative to the viewport, in which case
It's not a strong feeling, but I'd lean towards making I agree that it's probably fair to cross the bridge later like you say, but still good to keep in mind. |
Update: I've added some notes on next steps for the WIP PR here (#44723 (comment)) along with a couple of comments on the current blockers — still a fair bit more to be done before it'll be ready for testing. I'll be AFK off and on for the next couple of weeks, but will pick up the PR again once I'm back. A few thoughts / things that might be good to get some design input on:
I'll just add the Needs Design label — I think the controls for selecting position, and the desired mobile behaviour probably need a little more exploration prior to working much further on the WIP PR. In the meantime, I'll be happy to pick up the Layout -> ToolsPanel task once I'm back if no-one beats me to it 🙂 |
I'm not in love with the following mockup, but for now it can maybe serve as a general idea of how it might work: Outside of compression to a single row, the dropdown would theoretically scale to relative and static positions, if we chose to include those at some point. What do you think?
It is likely that we will need to tackle something along the lines of #19909 to enable this and similar cases, but for the near future I'd keep it simple and just have the behavior be the same across all breakpoints. |
It seems important not to conflate Do we need the "Placement" control? It appears that making something sticky relative to the bottom of the viewport is a bit hacky. It also doesn't solve the fixed-footer use case. |
I like to start with as little as possible, and only add controls when we know for sure they are needed. I'd love to start with just the segmented control if we can. |
+1. Position
Feels like a good place to start and a very neat enhancement on its own. |
I've updated this issue with the latest mockups and ideas from the comments. It was already assigned a dev, so hopefully this just adds clarity! |
Thanks for updating the designs! Just to double-check, so in the initial implementation we are only allowing sticky to the top position, and not footer positions (the issue title still flags footer)? The way I've implemented how we store the data for it in the WIP PR, we can support more positions (e.g. footer), but I agree with the idea here that we'd expose only the minimal control to begin with. It also very much helps us explore building this feature incrementally. Though I do really like the additional placement control in this comment: #30121 (comment), perhaps for a follow-up? |
Yes, purely to keep the implementation as simple as possible, and I would consider it mainly a UI thing. I'm sure we'll follow up, it might also allow us to refine the placement control a bit; even if it might work, it's a little complex. |
Update: there's been lots of great discussion on this feature lately, so I thought I'd try to recap where things currently sit, as the discussion is spread across a number of PRs:
Quick links for active work:
|
I created mockups in #46032 (reply in thread) that try to take a near-term/long-term look at it.l What do you think? Thank you for the update 🙏 |
I'm wrapping up for the year now, so just a quick update on the current WIP work exploring a solution for this (with discussion still ongoing over in: #46032)
If anyone is keen to jump in to any of this work while I'm away, feel free to hack away at any of the open PRs, take them for a spin, or offer feedback on the discussions. In particular, any feedback on the usability of the current WIP (#46142), and accessing the position UI from within the sidebar will be helpful, along with any insights or suggestions for how to resolve issues with the block selection toolbar (#46565). No worries if no-one has a chance to look at it, though, I'll pick all this up again when I'm back! 👋 |
Update: we've merged in the initial PR to implement this feature in #46142. To recap where the feature currently stands:
There's a fair bit more to do to improve on the feature and build out some of the remaining features, tasks and use cases. As flagged in reviews in #46142, there is a discoverability issue in setting up a site with a fixed header, given that it's a bit fiddly to do with 'sticky' alone. For any ideas, suggestions, improvements, or thoughts on direction for the feature, let's add to the tasks over in #47043 — feel free to edit / add to that list as anyone sees fit! Thanks again for all the collaboration on honing in on an MVP for the feature within the plugin 🤗 |
Just including a screengrab of the current state of this feature, for quick reference. The screengrab below demos wrapping a header template part in a group block, setting that group block to full width, then setting that group block to "sticky": header-wrapped-in-sticky-group.mp4 |
There has been a little talk already about adding background image support for Template Parts. This would likely include an option to set the background image in a fixed position, similar to the option currently available for the Cover block. However, I think it would be useful to extract this option from being specifically tied to background settings, and make it a more general option.
Based on conversation in this thread, here's a mockup:
When a group has been set to sticky, the list view is segmented into sticky and scrollable categories:
As needs emerge, we can explore adding additional options, including placement.
Issue updated Nov 3.
Initial proposal
There has been a little talk already about adding background image support for Template Parts. This would likely include an option to set the background image in a fixed position, similar to the option currently available for the Cover block. However, I think it would be useful to extract this option from being specifically tied to background settings, and make it a more general option that’s available to Header and Footer Template Parts whether or not they have a background applied.
I can see this option working well in the “Advanced” settings for the Template Part in the Block Inspector, alongside potential new icon options for setting a Template area as shown in PR #30005:
For a working example, Invision prototypes have a similar option allowing you to lock elements to the top or bottom of the browser window:
The text was updated successfully, but these errors were encountered: