Show or hide dynamic blocks based on URL query strings
-
Can you please advise where I can get doumentation / video for this Free Feature “Show or hide dynamic blocks based on URL query strings. Great for marketing campaigns!”
Regards
ColinThe page I need help with: [log in to see the link]
-
Hi @kellscolin2020,
Here is the Query String control documentation link. Let me know if I can answer any additional questions.
Best,
NickHi Nick
Thank you for your prompt reply.
At this stage I’m not seeing the Visibility section on the blocks.
Here’s what I’m attempting.
I have four COLUMNS blocks on my front page that I want to hide.
Until the menu option for a column is selected I want that column to then become visible.In Block Visibility
I have added QUERY to the Default visibility controls.
Block manager shows Paragraph and Column enabled.Visibility controls are not showing on the block for Columns or Paragraph
I have enabled Full Control Mode.
Regards
ColinChecked a bit further, Visibility controls are not showing on the block for Columns or Paragraph in the FRONT page I want to work with.
With other pages the Visibility controls and Query are showing on the block for Columns or Paragraph.
I suspect this is due to me earlier installing Block Visibility, trying it out then uninstalling I did have Uninstall ticked.
Hi @kellscolin2020,
The Visibility panel should display on all Columns and Paragraph blocks regardless of the page you are editing and the uninstall settings.
If the panel is not displaying, can you share with me your current WordPress version, theme, and any active plugins? I can then try and replicate the issue on my end. You can easily pull this information by navigating to Tools -> Site Health then click on the Info tab and select “Copy site info to clipboard”.
Thanks,
NickHi Nick
Just working on the page.
What I have found is if I create a new page and insert reuseable blocks, the visibilty controls work on these blocks.
However there seems to be one block that turns the visibilty controls off for the whole page.Just need to idenitify this block/s and maybe created a new block.
Give you an update soon.
Hi Nick
Here’s the info you requested.
`
### wp-core ###version: 6.0.1
site_language: en_US
user_language: en_US
timezone: Pacific/Auckland
permalink: /%postname%/
https_status: true
multisite: false
user_registration: 1
blog_public: 1
default_comment_status: open
environment_type: production
user_count: 3
dotorg_communication: true### wp-paths-sizes ###
wordpress_path: /home/store780/public_html
wordpress_size: 96.25 MB (100922834 bytes)
uploads_path: /home/store780/public_html/wp-content/uploads
uploads_size: 182.35 MB (191206435 bytes)
themes_path: /home/store780/public_html/wp-content/themes
themes_size: 30.14 MB (31605053 bytes)
plugins_path: /home/store780/public_html/wp-content/plugins
plugins_size: 126.67 MB (132819791 bytes)
database_size: 1.08 GB (1156724842 bytes)
total_size: 1.50 GB (1613278955 bytes)### wp-dropins (1) ###
advanced-cache.php: true
### wp-active-theme ###
name: Astra (astra)
version: 3.9.1
author: Brainstorm Force
author_website: https://wpastra.com/about/?utm_source=theme_preview&utm_medium=author_link&utm_campaign=astra_theme
parent_theme: none
theme_features: core-block-patterns, astra_hooks, widgets-block-editor, align-wide, automatic-feed-links, title-tag, post-thumbnails, html5, post-formats, custom-logo, customize-selective-refresh-widgets, editor-style, woocommerce, rank-math-breadcrumbs, amp, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, widgets, menus
theme_path: /home/store780/public_html/wp-content/themes/astra
auto_update: Disabled### wp-themes-inactive (1) ###
Twenty Twenty-Two: version: 1.2, author: the WordPress team, Auto-updates disabled
### wp-plugins-active (17) ###
Block Visibility: version: 2.4.3, author: Nick Diego, Auto-updates disabled
Fluent Forms: version: 4.3.10, author: Contact Form – WPManageNinja LLC, Auto-updates disabled
FluentSMTP: version: 2.1.2, author: FluentSMTP & WPManageNinja Team, Auto-updates disabled
Printful Integration for WooCommerce: version: 2.1.34, author: Printful, Auto-updates disabled
Product Category Tree: version: 2.5, author: AWESOME TOGI, Auto-updates disabled
Profile Builder: version: 3.7.8, author: Cozmoslabs, Auto-updates disabled
PW WooCommerce Bulk Edit Pro: version: 2.334, author: Pimwick, LLC, Auto-updates disabled
Speed Booster Pack: version: 4.5.5, author: Optimocha, Auto-updates disabled
Ultimate Responsive Image Slider Pro – Version 7.5.5: version: 7.5.5, author: WP Frank, Auto-updates disabled
WooCommerce: version: 6.8.0, author: Automattic, Auto-updates disabled
WooCommerce Menu Cart: version: 2.12.0, author: WP Overnight, Auto-updates disabled
WooCommerce PayPal Payments: version: 1.9.2, author: WooCommerce, Auto-updates disabled
WooCommerce Product Variations Swatches Premium: version: 1.0.11, author: VillaTheme, Auto-updates disabled
WOOCS – WooCommerce Currency Switcher: version: 2.3.8, author: realmag777, Auto-updates disabled
WP-DBManager: version: 2.80.8, author: Lester ‘GaMerZ’ Chan, Auto-updates disabled
WPCode – Insert Headers, Footers, and Code Snippets: version: 2.0.1, author: WPCode, Auto-updates disabled
Yoast SEO: version: 19.5.1, author: Team Yoast, Auto-updates enabled### wp-plugins-inactive (2) ###
Autoptimize: version: 3.1.0, author: Frank Goossens (futtta), Auto-updates disabled
Ultimate Blocks: version: 2.5.2, author: Ultimate Blocks, Auto-updates disabled### wp-media ###
image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1808
imagemagick_version: ImageMagick 7.1.0-20 Q16-HDRI x86_64 2022-01-22 https://imagemagick.org
imagick_version: 3.7.0
file_uploads: File uploads is turned off
post_max_size: 64M
upload_max_filesize: 128M
max_effective_size: 64 MB
max_file_uploads: 50
imagick_limits:
imagick::RESOURCETYPE_AREA: 251 GB
imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
imagick::RESOURCETYPE_FILE: 12288
imagick::RESOURCETYPE_MAP: 251 GB
imagick::RESOURCETYPE_MEMORY: 125 GB
imagick::RESOURCETYPE_THREAD: 1
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, ASHLAR, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUBE, CUR, CUT, DATA, DCM, DCR, DCRAW, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FARBFELD, FAX, FF, FILE, FITS, FL32, FLV, FRACTAL, FTP, FTS, FTXT, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, KERNEL, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORA, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, QOI, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RMF, RSVG, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YAML, YCbCr, YCbCrA, YUV
gd_version: 2.2.5
gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
ghostscript_version: 9.25### wp-server ###
server_architecture: Linux 3.10.0-962.3.2.lve1.5.68.el7.x86_64 x86_64
httpd_software: Apache
php_version: 7.4.30 64bit
php_sapi: litespeed
max_input_variables: 1000
time_limit: 60
memory_limit: 1024M
max_input_time: 60
upload_max_filesize: 128M
php_post_max_size: 64M
curl_version: 7.71.0 OpenSSL/1.1.1p
suhosin: false
imagick_availability: true
pretty_permalinks: true
htaccess_extra_rules: true### wp-database ###
extension: mysqli
server_version: 5.7.39
client_version: 5.7.38
max_allowed_packet: 1073741824
max_connections: 180### wp-constants ###
WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /home/store780/public_html/wp-content
WP_PLUGIN_DIR: /home/store780/public_html/wp-content/plugins
WP_MEMORY_LIMIT: 40M
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: false
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: true
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: Undefined
DB_CHARSET: utf8
DB_COLLATE: undefined### wp-filesystem ###
wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
mu-plugins: writableI have found I can create a new page, upload reusable blocks and all looks fine.
Publish and Save the page then reopen the page, visibilty controls gone.I have disabled Ultimate Blocks and just retrying a new page creation.
Cheers
ColinHi Nick
All very confusing but I have found if I have the four separate column blocks in the same page, visibilily gets turned off for all blocks on that page.I wanted all as the entire page is bookmarked and accessed very quickly from the menu.
But needs Visibility rules to only display the selected block.If I only have the two small blocks on one page all works ok.
If I either of the other two larger Column Blocks are in separate pages all works ok.
Combine the two larger blocks in one page, visibilily gets turned off for all blocks on that page.
Combine two smaller blocks and either one of the two larger blocks in one page, visibilily gets turned off for all blocks on that page.Appears to be a physical size problem maybe SQL DB related ?
Ultimate Blocks plugin has no effect on this problem.
Regards
Colin- This reply was modified 2 years, 3 months ago by Colin Kells.
Hi Colin,
It sounds like there might be a conflict with another plugin. So far I have been unable to replicate on my end.
Can you try adding the following to a brand new page in WordPress? Simply copy and paste the markup below into the page. It’s a simple three-column layout with some dummy text.
Ensuring there are no other third-party blocks on the page, please check if the Visibility panel is visible for all blocks. Note you need to ensure Full Control Mode is enabled in the plugin settings for the panel to display on Column blocks. The panel does display by default for Columns blocks.
<!-- wp:columns --> <div class="wp-block-columns"><!-- wp:column --> <div class="wp-block-column"><!-- wp:paragraph --> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean aliquet felis euismod pretium consectetur. Integer sed lorem sit amet mauris tristique convallis.</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:paragraph --> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean aliquet felis euismod pretium consectetur. Integer sed lorem sit amet mauris tristique convallis.</p> <!-- /wp:paragraph --></div> <!-- /wp:column --> <!-- wp:column --> <div class="wp-block-column"><!-- wp:paragraph --> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean aliquet felis euismod pretium consectetur. Integer sed lorem sit amet mauris tristique convallis.</p> <!-- /wp:paragraph --></div> <!-- /wp:column --></div> <!-- /wp:columns -->
Hi Nick
I’ve inserted using Code Editor then converted to blocks.
This shows 3 blocks with code in side.Each column has Visibilty ON
- This reply was modified 2 years, 3 months ago by Colin Kells.
Hi Nick
I have read today that there is a WordPress Block Limit of 21 blocks per page.
Have not been able yet to find a method of increasing the block limit.
So I’m going to change back to Menu opening a new page at bookmark, slower operation but does work.Hi Colin,
There is no limit on the number of blocks you can have on a page in WordPress, so that’s not the issue. Can you post a link to where you read that? If possible, I would like to get that corrected.
Concerning the block markup I posted earlier, forgive me if I was not entirely clear on the instructions. When pasting into the Editor, you can either open the Code Editor from the options menu and paste the code there or in the Visual Editor, you can Edit -> Paste and Match Formatting (Style).
The block layout can also be manually replicated by adding a Columns block to a blank page with three columns and add a Paragraph block to each column. Ensuring Full Control Mode is enabled, you should see the Visibility panel in the sidebar when selecting each block on the page. On the page, you should have one Columns block, three Column blocks, and three Paragraph blocks.
If you do not see the Visibility panel, please check to see if there are any console errors. That will help me diagnose further. Here are instructions on how to check in Chrome.
Thanks,
NickHi Nick
I have a file page export from WordPress 57Kb I want to send to you.
This contains 3 pages
1 Page Womens Shirts – Visibility working
2 Page Mens Shirts – Visibility working
3 Mens and Womens Shirts – Contains both 1 & 2
This page was ok during construction and saving Visibility working.
The problem as before occurs when the page is closed and reopened, Visibility controls gone.Please advise how I can get this to you.
Word Press will not allow me to post my email addressHi Colin,
Yes, we cannot share email addresses in the WordPress forum, and unfortunately, I cannot direct you to an outside source for additional support, per the forum guidelines.
That said, were you able to test with the Columns block example I provided in the previous comment? Also, can you tell me all the blocks you are using to display the Mens/Womans shirts, i.e. the names of the blocks and any third-party plugins that provide those blocks? This will allow me to test further on my end.
Thanks,
Nick`Can I post code like your previuos
“test with the Columns block example”
All test ok Visibilty options are available
- The topic ‘Show or hide dynamic blocks based on URL query strings’ is closed to new replies.