Hello team! I’m building a custom backend panel using Bricksforge and ran into an issue with the SPA routing.
When I place a standard link (<a>) inside a custom admin page that points to another native WordPress admin page (e.g., /wp-admin/admin.php?page=my-custom-pool), the Bricksforge router intercepts the click and loads the target via AJAX, causing an “Inception” effect (loading the WP sidebar and header inside the current container).
I tried adding target="_top" to force a hard reload and break out of the frame, but the router still intercepts it via preventDefault().
Current workaround: I have to use onclick="window.top.location.href='...'" to bypass the router.
Feature Request/Bug Report: The SPA router should ideally check for target="_top" or target="_blank" on anchor tags and let the browser handle them natively without intercepting.
Thanks for the amazing tool!
General Information
Bricksforge Version:
( 3.1.8.5)
WordPress Version:
(6.9.4)
Server Information
PHP Version:
( 8.3.30)
Web-Server:
(Apache 2.4.66)
Description of the Issue / Request
I am building a custom backend panel using Bricksforge Admin Pages. I have a custom view where I need a “Back” button to return to another native WordPress admin page (/wp-admin/admin.php?page=my-custom-pool).
The Issue: The Bricksforge SPA router intercepts all <a> link clicks to load them via AJAX. This causes an “Inception” effect where the entire WordPress admin sidebar and header are loaded inside the current container.
To prevent this, I added the target="_top" attribute to the link to force a native browser navigation. However, the Bricksforge router still intercepts the click and prevents the default behavior, ignoring the target attribute entirely.
Expected Behavior: The SPA router should check if an <a> tag has target="_top" or target="_blank". If it does, the router should skip the interception and allow the browser to handle the native navigation.
Actual Behavior: The router intercepts the click via preventDefault(), forcing an AJAX load that breaks the layout by nesting admin panels.
Current Workaround: I had to remove the href and use raw JavaScript to bypass the router: onclick="window.top.location.href='/wp-admin/admin.php?page=my-custom-pool'"
Proposed Solution: Please add a simple check in your routing JavaScript to ignore links with specific target attributes, allowing developers to break out of the SPA frame when necessary.
How to Reproduce
- Create a custom Admin Page in Bricksforge.
- Inside that page, add an
<a>element (either a native HTML anchor inside a Basic Text element or a Bricks Text Link element). - Set the
hrefto any native WordPress admin page, for example:href="/wp-admin/edit.php"orhref="/wp-admin/options-general.php". - Add the attribute
target="_top"to the link. - Save the page and view it in the WordPress backend.
- Click the link.
What Actually Happens: The Bricksforge SPA router intercepts the click, ignores the target="_top" attribute, and loads the target page (e.g., the Settings page) inside the current container using AJAX. This results in the WordPress sidebar and top bar being duplicated inside the content area.
What Should Happen (Expected Behavior): The router should recognize the target="_top" attribute and let the browser perform a standard, full-page navigation, breaking out of the SPA frame completely.