Help please! How to change headings...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mattcooper
Forum Contributor
Posts: 210
Joined: Thu Mar 17, 2005 5:51 am
Location: London, UK

Help please! How to change headings...

Post by mattcooper »

I am desperate for a solution to this problem which, after much head-scratching, I cannot easily solve.

I am building an ezine, the content of which appears in an inline frame. I have included a pop-up menu from which users can navigate to the page of their choice. When they select a page, a JavaScript event is triggered that changes the heading - which is simply text in a styled textfield.

The problem is that the user can also navigate using "previous" and "next" buttons, which means that the heading doesn't then change - it simply stays as it was for the previous page.

The other part of this beast of a problem is that I need the nav buttons to sequence through the pages without the need to reload the main page: a truly "next" and "previous" function, dependent on which page is currently displayed in the iframe. Page 1 goes to page 2 etc. without reloading. I have serious doubts that this is possible, so I'm prepared to allow the page to reload if necessary - it would then load up with the new iframe content, I suppose.

I think that this is a very complex problem, and I have a deadline to meet unfortunately. Can somebody please put me out of my misery?

Thanks in advance.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

extremely simple solution: don't use iframes or frames. It works wonders.
User avatar
mattcooper
Forum Contributor
Posts: 210
Joined: Thu Mar 17, 2005 5:51 am
Location: London, UK

Post by mattcooper »

Thanks Feyd...

Unfortunately, I working to a brief that states no scrolling allowed - and where there is too much content in a page of the ezine, I am forced to resort to an iframe to avoid the appearance of scrollbars (could use a layer, I suppose).

Any thoughts?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

sounds more like poor page design if you can't use scrollbars. :? All your links could always reference the top level page with some information passing that tells it what junk to display... Could use div's with proper CSS controls that'd ~stop the scrollbars..
User avatar
mattcooper
Forum Contributor
Posts: 210
Joined: Thu Mar 17, 2005 5:51 am
Location: London, UK

Post by mattcooper »

Can you use a cookie to provide information about the next page to load into the iframe, Feyd? So, when "page1" loads, a cookie is written with the URL of the next page to display. Is it possible to "include" cookies in the same way as files on the server?

Thanks for your input so far... :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

cookies can be a bit of a pain between frames. I'd still suggest using a div, instead of an iframe, or working up a better page design that will work with this scrolling concept your design sounds like it'd break with...
User avatar
mattcooper
Forum Contributor
Posts: 210
Joined: Thu Mar 17, 2005 5:51 am
Location: London, UK

Post by mattcooper »

Feyd,

Can you instruct me on how to set a cookie that contains the URL of the next page to load? I'd really be most grateful!

Thank you.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

read the documentation on setcookie()
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

I am forced to resort to an iframe to avoid the appearance of scrollbars
That doesn't make any sense. If you use iFrames, they still default to scrollbars if there's an overflow... so... are you clipping the data?

Then what I suggest is taking the data and intelligently truncating the text at a certain page, making the user press NEXT > to get to the next page.
mudvein
Forum Commoner
Posts: 45
Joined: Wed Mar 16, 2005 4:39 pm

Post by mudvein »

Ambush Commander wrote:
I am forced to resort to an iframe to avoid the appearance of scrollbars
That doesn't make any sense. If you use iFrames, they still default to scrollbars if there's an overflow... so... are you clipping the data?

Then what I suggest is taking the data and intelligently truncating the text at a certain page, making the user press NEXT > to get to the next page.
that's not entirely true. if you set the frame to be a set height/width with no scrollbars, then of course they'd never show up...
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

But don't iFrames by default implement the CSS attribute:

Code: Select all

overflow : scroll ;
At least from my experience if I have a frame, and it's bigger than the set size, it will scroll.

Of course, if you set:

Code: Select all

overflow : clip ;
Then the scrollbars won't show up (or theoretically they won't). I was talking about defaults. I think.
mudvein
Forum Commoner
Posts: 45
Joined: Wed Mar 16, 2005 4:39 pm

Post by mudvein »

by default yes, but as i said, you could DEFINE it to disallow scrollbars within the original frame tag ;)
Post Reply