Coder Social home page Coder Social logo

Comments (10)

dkoo avatar dkoo commented on July 22, 2024 2

@kmwilkerson If we ever do decide to roll back the rollback of the block widget editor, this will be come relevant again, so let's put it on hold instead of closing it.

from newspack-ads.

dkoo avatar dkoo commented on July 22, 2024

Note that it is still possible to use the Legacy Widget block to place a legacy Ad Unit widget and use the sticky option, so this provides a good workaround until we can offer proper block-based widget support.

from newspack-ads.

adekbadek avatar adekbadek commented on July 22, 2024

Our experimental feature to enable sticky sidebar ad units in the sidebar widget area no longer works with this editor because the widget method in class-newspack-ads-widget.php is no longer fired by blocks-based widgets in WP 5.8, therefore our stick-to-top class name is never added to the widget's container. The widget block editor also uses a different UI which doesn't show the "Stick to top" option at all.

The (legacy) widget works, as you point out in the second comment. The issue is with the Ad Unit block, which can now be inserted in the widgets area, but does not offer the "stick-to-top" checkbox. Just making sure we're on the same page.

from newspack-ads.

adekbadek avatar adekbadek commented on July 22, 2024

Was too quick to self-assign, but I re-read the original comment:

The new widget block editor does provide a filter for the widget container's class names, but the filter doesn't really provide enough info about what's inside the widget to be useful for this.

:has() pseudo-selector would be a solution, but it's not implemented by any browser yet.

Started work on this on fix/sticky-ad-in-block. I think it's best to replicate the widget logic in block, since the widget and the block are essentially different creatures, and the former will become obsolete.

from newspack-ads.

dkoo avatar dkoo commented on July 22, 2024

I think it's best to replicate the widget logic in block, since the widget and the block are essentially different creatures, and the former will become obsolete.

That was my thinking, too, and I had begun playing around with replicating the behavior using block attributes, but I didn't get as far as you have. Thanks for getting things going!

from newspack-ads.

kmwilkerson avatar kmwilkerson commented on July 22, 2024

@adekbadek @dkoo Since we've rolled back use of the block widget editor, confirming we can close this issue?

from newspack-ads.

adekbadek avatar adekbadek commented on July 22, 2024

If we ever do decide to roll back the rollback of the block widget editor

Now it happened! Automattic/newspack-plugin#1550

@miguelpeixe – could you have a look at this? With the latest refactoring and block work, seems like you're in best position to tackle this. Is it still a relevant issue?

from newspack-ads.

miguelpeixe avatar miguelpeixe commented on July 22, 2024

Thanks, @adekbadek!

Another feature that has been introduced since this issue is the "before/after" widget area global placements. One of the global placements feature is the "stick to top" that can have its support enabled on the placement registration.

The sidebar is currently registered with this support:

if ( in_array( $sidebar['id'], self::STICK_TO_TOP_SIDEBARS, true ) ) {
$supports[] = 'stick_to_top';
}

If the publisher uses the "after sidebar" placement with "stick to top" toggled on, the sticky behaves as expected in classic widgets or block-based widgets modes.

I believe this should be the official way. Ad unit blocks shouldn't have an option that only works in one particular position.

WDYT, @kmwilkerson ?

from newspack-ads.

kmwilkerson avatar kmwilkerson commented on July 22, 2024

I agree @miguelpeixe -- having the behavior function the same across both is ideal!

from newspack-ads.

miguelpeixe avatar miguelpeixe commented on July 22, 2024

Thanks, Katie! Closing the issue then.

from newspack-ads.

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.