Comments (4)
And in 5 minutes, we realized why we would definitely want to be able to show some blocks ONLY on printing, as well. :)
Example: We embed a youtube video. When someone prints, it just doesn't show up. We'd like to have a print-only block below it that shows a still image of the video along with the URL.
from block-visibility.
Hmm, this is an interesting use case. Have you considered using a Block Style for this? Or even a dedicated utility class?
I believe controlling print visibility would need to be done with CSS. Currently, only the Screen Size control uses CSS. All other controls actually removed the block from the page via the render_block
hook. I'm a bit hesitant to add more CSS-based controls since they can so easily be overwritten unintentionally by theme or user styles. 🤔
from block-visibility.
Have you considered using a Block Style for this?
My main issue with Block Styles is the "select only one" nature of them. Take a Heading Block, for example. We have several different styles. What if I want "Red Lines on Both Sides" styles AND to hide it from printing?
I suppose it could be a Group style, and then you'd put the Heading (red lines style) inside the Group Block (hide when printing style), However, it sure feels pretty clunky using "Styles" to apply conditional logic.
Group Block Style - Hide when Printing
Group Block Style - Show only when Printing
Or even a dedicated utility class?
Another fine option for many, I'm sure. However, we're really trying to avoid this as much as possible, mostly because it's not really a great user experience for our content providers. Having to know that it's even an option, and remember the specific class, isn't ideal.
Totally get the reluctance to implement more CSS-based controls, of course. I thought it might be a good fit for Block Visibility, but completely respect the decision to not implement at this time. Cheers!
from block-visibility.
Got directed here from the forums and will add my vote for this.
I think it would go well with the screen size options which is also controlled by CSS, it could even be in the same place (as a checkbox below "hide on mobile"). While it could interfere or be overridden with other CSS styling it is unlikely, especially in the case of print. I belive there are a few dedicated printing plugins, but most themes don't bother with printing at all. If someone have a printing plugin they could just choose to disregard the option in this plugin.
The main use would be to hide navigation, CTAs and similar content (stuff that went into widgets in classic themes) that doesn't make sense when printed. For example if you have a mega menu all of it may be printed taking up several pages of print before the actual content.
Block styles wouldn't work as they don't stack, but of course adding a dont-print
class to blocks is possible (and trivial for anyone with knowledge of CSS). It just would be nice if this plugin took care of that as well.
from block-visibility.
Related Issues (20)
- Add the ability to export and import plugin settings.
- Add support for a "Color scheme" (dark mode/light mode) visibility setting HOT 1
- Add support for ACF fields from categories (taxonomies) HOT 1
- Add new Controls option for Shortcode and validate value similar to the ACF integration
- The visibility panel always "forces" all blocks to have the separate settings inspector tab HOT 3
- Add a LearnDash control HOT 1
- Add ability to display a block after a specific number of days since a post was published
- Add additional options to User Metadata
- Add support for Toolset
- Hide in editor
- Option to add fallback content for hidden blocks HOT 2
- Post visibility HOT 2
- Support regex for URL path HOT 1
- Move location of Visibility Panel? HOT 1
- Enable Visibility Panel on a per-page basis HOT 1
- Block Manager - toggle between Disallowed and Allowed lists
- Feature Request: Seasonal display HOT 1
- Necessity to have rewrite_rules created for the visibility_presets post_type HOT 2
- tore "core/interface" is already registered. HOT 3
- wp.date.__experimentalGetSettings is deprecated 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 block-visibility.