Comments (10)
@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.
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.
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.
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.
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.
@adekbadek @dkoo Since we've rolled back use of the block widget editor, confirming we can close this issue?
from newspack-ads.
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.
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:
newspack-ads/includes/class-sidebar-placements.php
Lines 135 to 137 in f7fdc03
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.
I agree @miguelpeixe -- having the behavior function the same across both is ideal!
from newspack-ads.
Thanks, Katie! Closing the issue then.
from newspack-ads.
Related Issues (20)
- Add Publisher Media Kit plugin to Add-Ons
- Extend ad suppression to allow suppression on all posts in a single category HOT 3
- Unrecoverable error on launch of ads option HOT 2
- GAM Data Display
- Ad units are getting duplicated when oauth is disconnected HOT 1
- GAM API repeatedly getting disconnected HOT 1
- Value CPM not being properly input
- Add parent path (if detected) to ad unit code HOT 2
- Only display Ad Label setting if AMP Plus enabled HOT 5
- PHP 8: sorting functions update HOT 2
- Fields and script required for ad block recovery messaging HOT 1
- Add custom choice to ad block recovery
- Only show the ad recovery message after a certain number of pageviews
- Don't show ad recovery message to subscriber or donor
- Allow Broadstreet to run in AMP Plus mode
- Fixed height settings not getting applied on placements with multiple hooks
- Restore GAM error messages HOT 2
- Change 160x600 assignment in size mapping rules
- Handle oauth without GAM networks HOT 3
- Request for guidance on displaying Adsense ads. 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 newspack-ads.