Targetting back to a main page

I have a textlink-to-new-window action which opens a press release in a new, smaller window above the main site. Near the end of the release I want to have a link to the site’s Contact page which is part of the main run of pages.

How do I target this link to open the Contact page within the main site window rather than within the small ‘pop-up’ window I’m in?

Hugh


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Try changing the Target attribute of the link to _parent and see if
that works. I am not sure if it does with a JavaScript-opened
“daughter” window. The harder but completely guaranteed way to do it
is full-on JavaScript.

  1. Change the URL of your link so it is a single hash: #
  2. Click on Extended in the Hyperlink dialog, then the New button in
    the resulting dialog.
  3. In the Name field, enter onclick
  4. In the Value field, enter the following incantation. (I’ve split it
    to two lines for viewing, it should all be one line.)
self.opener.window.location.href='path/to/your/page.html';
return self.opener.focus();

Okay out of the stack of dialogs, and test that in a browser. It
should do the trick. Whenever JavaScript is used to open a new window,
the new window gets a property named ‘opener’, populated with an
object reference to the window that did the opening. Comes in very
handy sometimes.

Walter

On Jul 28, 2009, at 6:37 AM, hugh wrote:

I have a textlink-to-new-window action which opens a press release
in a new, smaller window above the main site. Near the end of the
release I want to have a link to the site’s Contact page which is
part of the main run of pages.

How do I target this link to open the Contact page within the main
site window rather than within the small ‘pop-up’ window I’m in?

Hugh


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

_parent didn’t work, but your javascript full code worked a treat.

Thanks Walter. I have to say it, but…what would we do without you! (I truly AM staggered by the amount you know!)

Hugh


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Actually, there’s one interesting observation to this fix…

The link does exactly what it says on the tin, but it doesn’t close the child window. Effectively it brings the main window to the foreground, but the child window is still open in the background.

I don’t think that this is a big deal, just that if you do click the link to open the child window again, you don’t get anything…because the child window is already open BEHIND the main window.

Just an observation!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Are you giving your child window a Name property in the Action? If you
are, then targeting a named window is supposed to also bring that
window to focus. If you want to extend the JavaScript that I posted to
also close the daughter window, then try this:

self.opener.window.location.href='path/to/your/page.html';
self.opener.focus();
return self.window.close();

Again, all on one line. The daughter window will slip behind the
parent, then close (not tested, but it should work).

Walter

On Jul 28, 2009, at 10:03 AM, hugh wrote:

Actually, there’s one interesting observation to this fix…

The link does exactly what it says on the tin, but it doesn’t close
the child window. Effectively it brings the main window to the
foreground, but the child window is still open in the background.

I don’t think that this is a big deal, just that if you do click the
link to open the child window again, you don’t get
anything…because the child window is already open BEHIND the main
window.

Just an observation!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Forgot to add – you have to use the same name for all links in order
for this to be true. I like to make mine something I won’t mistype,
like pop. This lets multiple links recycle the same window, which can
hide behind the main window, or be closed, with the same effect.

Walter

On Jul 28, 2009, at 10:24 AM, Walter Lee Davis wrote:

Are you giving your child window a Name property in the Action? If
you are, then targeting a named window is supposed to also bring
that window to focus.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yes, that worked nicely Walter, thanks!


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options