0

I have embedded HTML in a block which renders a Python console. What I want to do is to be able to pop-out the Block in a separate window.

If that is not possible then may be a link that when I click on it pops-up a page that contains the console.

How do i do that ?


I don't want the pop-up to be full-screen. I want to be able to move it around, so the text below can be seen.

The HTML can be anything, I just give it as example. Let say :

<div id=ABC>12345</div>

i know js/html/css but no idea of how wp works...

Do i just embed html link with onclick=window.open(...) pointing to a wp-page ? Ooo but i have to somehow make it pure page i.e. no theme !! HOW?

And second i have to hide ABC !


Got it : https://myriad.website/create-popup-window/

here is working : https://myriad.website/learn-python/

dont look at the site ... it is still under construction ;)

5
  • What is the console? How does it work? What’s the HTML? Commented Nov 1, 2021 at 15:17
  • 1
    If I'm understanding correctly, you want the block to appear full-screen. You could make it a link, which links to a particular page/post/cpt on your site - and that page/post-cpt would need to have a custom theme template. The custom template would call wp_head() and wp_footer() but in between only output the HTML, so the only thing on that page would be the console, no header/footer/etc. You might need to output a stylesheet for that template to force the console to appear full-screen.
    – WebElaine
    Commented Nov 1, 2021 at 15:37
  • how do i make it popup
    – sten
    Commented Nov 1, 2021 at 16:52
  • @sten there is no code in your question, but I also don't believe WordPress knowledge will be useful to you here. Generic frontend HTML/CSS/JS knowledge is what you need
    – Tom J Nowell
    Commented Nov 1, 2021 at 17:30
  • i know js/html/css but no idea of how wp works
    – sten
    Commented Nov 2, 2021 at 2:06

1 Answer 1

0

Solved it : https://myriad.website/create-popup-window/

here is working : https://myriad.website/learn-python/

First install the “Blank Slate” plugin.
Create New Page
Leave the Title empty
Set in Page property Template=”Blank Slate”
Add whatever content you want
Because there is no Title, we need set a Permalink so that is human readable, let say : your-site/blah
Publish the page
Go to the page you want to have the popup window show up on clicking a link
Add the following code :

<a href='' onclick='window.open("https://your-site/blah/","window-name","width=400,height=320");' target='blank'>Popup window</a>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.