Forums / General Questions / Creating a link to a page without header

Creating a link to a page without header

Locked
Results 1 to 4 of 4
This thread is locked. New replies are disabled.
12 Jul 2007, 02:41
#1
mygreygoose avatar

mygreygoose

New Zenner

Join Date:
Jun 2007
Posts:
91
Plugin Contributions:
0

Creating a link to a page without header

What I'm trying to do seems like it should be super easy. I want to create a hyperlink in a page that when clicked opens up the linked page in a new window WITHOUT including the header, and all the other stuff. Basically, if this were html, I would want to create a link like:

 <a href="http://www.mysite.com/mypage.htm" target="_blank">My Page</a>
Better yet, what I've tried is this:

 <a href="#" onclick="window.open('index.php?main_page=myNewPage', '_blank', 'scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=40,top=20'); return true">My New Page</a>
I've gotten this to work, but it opens in a new window within the framework of my site (with the header, etc.). I just want the file by itself, which is just html.

I've only found forum, wiki, tutorial references to something involving 4 files or javascript or zen functions, etc. If these are the only ways to do this, I'll figure it out. But there has to be an easy way to do this.

Ideally, I'd be able to create the html or php file in EZ Pages (or Define Pages?) and then based on that EZ Page file, I can reference it in a code snippet on other pages.
12 Jul 2007, 03:01
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Posts:
31,500
Plugin Contributions:
4

Re: Creating a link to a page without header

Create a mypage.html file that represents what you want displayed and upload it to your server.

Then using ezpages, link to this page as external i.e. http://mysite.com/mypage.html
12 Jul 2007, 17:03
#3
mygreygoose avatar

mygreygoose

New Zenner

Join Date:
Jun 2007
Posts:
91
Plugin Contributions:
0

Re: Creating a link to a page without header

Thanks! I was able to get this to work (I actually used an internal link instead of external since I'll be changing servers). However, it does not actually open in a new window in Firefox. It works in IE, but not Firefox. This is the code I used:

<?php echo zen_ez_pages_link(16, 0, false, true, true); ?>

When I hover over the link on my site, the URL is this:
http://localhost/zencart/riotclubfaq.htm?target="_blank
I also experimented with the New Window status in the EZ Page admin page, but that didn't seem to make a difference.

Is there some way to force this to work in Firefox? I'm willing to mess with the code if necessary. Also, is there some way to control the new window that pops up, e.g., window size, removing the menu, scroll bars, etc.?
12 Jul 2007, 18:28
#4
mygreygoose avatar

mygreygoose

New Zenner

Join Date:
Jun 2007
Posts:
91
Plugin Contributions:
0

Re: Creating a link to a page without header

I've gotten something to work. It's a hack as far as I'm concerned. This uses the window.open command so that I can get the page to open in both IE and Firefox with the parameters I want. I am totally open to better ways of doing this, if anyone has a suggestion.

<a href="#" onclick="window.open('<?php echo '' . $_GET['DIR_WS_LANGUAGES'] . ''?> <?php echo 'nutrition.htm'; ?>', '_blank', 'scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=40,top=20'); return true">more nutrition info</a><br>
The thing I'm winging and don't understand is the $_GET['DIR_WS_LANGUAGES'] call. It does what I need it to (returning http://mysite.com/), but I'm not sure if there's a better way to do this, AND the fact that I'm using DIR_WS_LANGUAGES (which I thought would point to http://mysite.com/includes/languages/ but doesn't). All of the other server variables just point to the root host too. So, is there more proper code I should be using?

Again, if anyone has a better, easier way to do this whole thing, I'm listening!