[solved] how do i make a page pop open in a new (federated) window?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
tonyg
Forum Members
Forum Members
Posts: 80
Joined: Sun Dec 14, 2008 4:54 am

[solved] how do i make a page pop open in a new (federated) window?

Post by tonyg »

hi,
 I would like to have a page pop open a new (federated) browser window that just has borders and no browser menu's.  setting the option to _blank does not do that, it opens a different tab in FF or a complete browser in IE.  I think javascript does this with a window.open, can i add logic to the page so it behaves that way?
Last edited by tonyg on Fri Oct 16, 2009 1:32 am, edited 1 time in total.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: how do i make a page pop open in a new (federated) window?

Post by jmcgin51 »

use Javascript to open the window

If you don't know how, Google is your friend.  This is really a Javascript question, not a CMSMS question.
tonyg
Forum Members
Forum Members
Posts: 80
Joined: Sun Dec 14, 2008 4:54 am

Re: how do i make a page pop open in a new (federated) window?

Post by tonyg »

hi,
  would i put it in the "Smarty data or logic that is specific to this page:" section of the page?
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: how do i make a page pop open in a new (federated) window?

Post by jmcgin51 »

no, just in the page content itself.

also see http://wiki.cmsmadesimple.org/index.php ... your_pages
tonyg
Forum Members
Forum Members
Posts: 80
Joined: Sun Dec 14, 2008 4:54 am

Re: how do i make a page pop open in a new (federated) window?

Post by tonyg »

right, so i would have to put that into the template, is there a way to put that into an individual page without affecting other pages that use that template?
Peciura

Re: how do i make a page pop open in a new (federated) window?

Post by Peciura »

Try

Code: Select all

{popup_init src='http://myserver.org/my_js_libs/overlib/overlib.js'}
{popup text='This link takes you to my page!'}
all parameter can be found at http://www.smarty.net/manual/en/languag ... .popup.php
Link to overlib library is also listed.
Last edited by Peciura on Thu Oct 15, 2009 5:14 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: how do i make a page pop open in a new (federated) window?

Post by calguy1000 »

I love jquery...
with a little bit of menu manager magic... and jquery
you could easily have popup windows in your navigation:

http://abeautifulsite.net/notebook/47
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: how do i make a page pop open in a new (federated) window?

Post by jmcgin51 »

tonyg wrote: right, so i would have to put that into the template, is there a way to put that into an individual page without affecting other pages that use that template?
you can use it like any Javascript.  If something needs to go in the , then you put it in your template and call it in the page.  If nothing needs to be in the , just call it within the page.
tonyg
Forum Members
Forum Members
Posts: 80
Joined: Sun Dec 14, 2008 4:54 am

Re: how do i make a page pop open in a new (federated) window?

Post by tonyg »

all,
  thanks for all your input.  here is what i ended up doing.

the problem is that i wanted to pop up some pages from the menu to a new window (not tab).

what i did was made a new menu template.  in that template, i change the tag to include an onclick like this:

Code: Select all

{if $node->type != 'sectionheader' and $node->type != 'separator'} onclick="window.open('{$node->url}','','directories=no,location=no,status=no,menubar=no,resizable=0,width=650,height=600');return false;" 
href="{$node->url}" {if $node->accesskey != ''}accesskey="{$node->accesskey}" {/if}{if $node->tabindex != ''}tabindex="{$node->tabindex}" {/if}{if $node->titleattribute != ''}title="{$node->titleattribute}"{/if}{if $node->target ne ""} target="{$node->target}"{/if}>> {$node->menutext}</a>

{/if}
the downside is that all the pages called by this template would be affected.  I was able to make it work.  What would be really nice is if I could have used an if then on a property of the page to choose whether or not it would be opened in a new window.

if anyone knows how to do that, please let me know.

thanks
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: [solved] how do i make a page pop open in a new (federated) window?

Post by jmcgin51 »

you could use one of the Extra page attributes as the trigger for your if/then

Extra1: popup

here's the pseudocode:

if pageattribute->extra1 == "popup"
  use the javascript popup script
else
  use the normal menu script
tonyg
Forum Members
Forum Members
Posts: 80
Joined: Sun Dec 14, 2008 4:54 am

Re: [solved] how do i make a page pop open in a new (federated) window?

Post by tonyg »

YES!  i think thats what i was looking for.  i will try that tomorrow.
Post Reply

Return to “CMSMS Core”