Giter Club home page Giter Club logo

Comments (4)

MadtownLems avatar MadtownLems commented on August 21, 2024

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.

ndiego avatar ndiego commented on August 21, 2024

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.

MadtownLems avatar MadtownLems commented on August 21, 2024

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.

audunmb avatar audunmb commented on August 21, 2024

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)

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.