|
Cookbook /
PopupWindowSummary: create popup windows
Version: 2008-04-17
Prerequisites: pmwiki 2
Status: stable
Maintainer: DaveG
Categories: Links
Download: popupwindow.phpΔ
Questions answered by this recipeHow can I create popup windows?
DescriptionEnter your recipe's description here. Download popupwindow.phpΔ, copy to in cookbook directory and install by adding to local customisation file: include_once("$FarmD/cookbook/popupwindow.php");
This adds the markup %popwin parameters%
Some of these will not always work in all browsers. Some are dependant on user settings in the browser. Popup links can be configured to pass different parameters for different links, by adding a unique id= number as a parameter. Additional markup:
(:if equal {$PopOpen} 1:)(:noleft:)(:popclose Close Window:)(:ifend:)
This will ensure the page functions normally when not opened as a popup, but it opens without the SideBar and with a "Close Window" link when "popped up" with %popwin%[[PageName?action=popopen| link text]]
Examples:
NotesRelease Notes
CommentsThere's an annoying side effect when using images in link descriptions: the
Has anyone tried using this for a link in the sidebar when the current page is not "Site.Sidebar"? For example, edit the sidebar to use this, save, then navigate somewhere else. Does the sidebar link still work? -- lordmundi July 10, 2007, at 07:48 AM See AlsoContributorsSandbox
CommentHi - Thanks for this cookbook. I really like $PopOpen features which works great except I have fixflow skin, which has an extra header menu called PageTopMenu and an extra footer menu called PageFootMenu. The commands to turn these off are (naturally) notopmenu and nofootmenu and are built into the skin. So at the end of each page that I want to use both as a regular page and a popup window, I add the line (:if equal {$PopOpen} 1:)(:noleft:)(:noright:)(:noheader:)(:nofooter:)
(:notopmenu:)(:nofootmenu:)(:popclose Close Window:)(:ifend:)
and then on the page where I want the link to bring up a trimmed popup window I write the link as: %popwin%[[myPopupPageLink?action=popopen|myPopupPageLink Text]]
and get a perfectly trimmed page with the Close Menu button. Thanks. LFS Hi, I'm having a ton of problems getting this to work. I'm trying to create a default pop-up that will work without me even clicking on a link. That pop-up will be a warning. So, I want people to visit my website and every time they click somewhere, there must be a pop-up automatically coming up giving them a small disclaimer page. Alternatively, I would just set that up on the homepage, but how do I set it automatically? I need step-by-step instructions. Thanks! Chris P.S. I forgot to add I'm using the Monobook skin. popup on a click anywhere sounds horrendous. You want tons of annoyed visitors? And how can they navigate if bombarded with popups? Or do you just want to stop visitors right-clicking, to stop easy downloading of photos? HansB July 14, 2008, at 08:59 AM Hans, You are right that it sounds horrendous, but I have to do it in order to implement a wiki site in my organization. The IT security folks said that was a condition, so there is no choice involved. Maybe what I could do is just have a pop-up every time someone visits the homepage. How do I do that? Thanks, Chris How about putting the disclaimer into a div, with nice frame and background perhaps, on your wiki homepage, and have it closed by clicking a button? You can use Cookbook:ShowHide for this. You can even position the div absolute, if you want to give the impression of a 'window' floating above content. you can include in the div markup style='position:absolute;top:100px;left:100px;width:400px;' etc. for your css, or create a class for it in css. I put an example on the ShowHide page - HansB July 15, 2008, at 07:15 AM Hans, Great idea! I looked into this concept and think that this will meet my needs better. On that note, would I be able to have the message show up so they don't have to click to open it? In other words, I want them to get to my homepage and see the disclaimer. In order to get rid of the disclaimer, they have to click on close. Thanks! July 16, 2008, at 09:56 AM Edit: I checked your comment again and you answered what I needed to know. Thanks! July 17, 2008, at 10:48 AM
Hans or anyone, I'm back for more. I've been playing with the show/hide function and this is what I have so far: (:toggle div=box2 style='position:absolute;top:100px;left:100px;width:400px;':) Remember that you may not post any content that could be considered rude, offensive, slander, or otherwise harmful to the community that will be reading all posts. That text does not float above my content and is almost just another part of the website. I would like a dark grey or blue box with red text that hovers over the content of a page with that text that could show/hide. Is there a way to get that to work? As always, thanks!July 24, 2008, at 18:06 PM Chris: You'd need to use 'position:fixed' in order to make the text appear in the same position regardless of how the window viewport was scrolled. However, IE6 has issues with fixed positioning, so this may or may not work for you.
~ ~ DaveG Dave, Thanks for your comment. I realized I was being uberly new to this, all I had to do is to click "edit" and copy and paste the source code already provided for pop up. Thanks! Chris Wow, great recipe! I was trying to figure out how to embed some really funky html and javascript in my wiki without opening it up to too many risks. But the popup window recipe solved all that - I can simple create a link to a small popup window. Matt L? August 30, 2008, at 10:17 PM I have been using this recipe for months and think it fantastic, but I was bummed thinking I could only have one popup window - then I saw the id=number option. This is such a great recipe!! LFS 4 September 2008 User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |