using FRAMEs, flash and Google issues

Author Message

Massimiliano Bariola

Friday 09 February 2007 7:09:18 am

hi,

a client wants an eZ Publish site with a rather graphic-heavy header. they want a big flash header which will serve as main navigation toolbar. this header will do some animations on clicking on an item and will load the corresponding page.

having a flash as navigator plus some animations means that if I do not use frames, it will be reloaded at every page thus getting a blank part of screen, and the animation would restart if I don't find a way to save the staus. anyway, the only option to actually not have a reload and keep the status and a smooth animation is to keep the header in a frame, and the content in another.

I have read some topics here, like http://ez.no/community/forum/setup_design/problem_using_an_iframe , and I think that having the two siteaccesses could be the solution - but I have this problem:

let's suppose I want to have my site at www.example.com. So I create the www.example.com siteaccess, and the (e.g. cframe.example.com one. www would load homepage loads the frames, the header and the homepage of cframe.example.com in the content frame.

The problem is that the links that eZ generates for cframe.example.com are of the form http://cframe.example.com .... and that would show up on google, while of course I would love to have the www.example.com (sub)domain to be indexed. especially because the link showing up on google would load the cframe site, without the navigation header.

changing the SiteURL parameter for the cframe siteaccess to www.example.com does not accomplish anything. the links are still rendered a cframe.example.com blah blah blah

the only option I seem to come up to make it all work would be this ....

- use only one siteaccess
- pagelayout detects somehow whether the header is displayed or not
- if it isn't, load it up and store some variable (cookie ... maybe)
- if not, just display the inner content

I don't like this much since it assumes that the user agent must have cookies and javascript enabled; but I cannot think of an alternative.

anyone can point me in the right direction? I think that if I was able to somehow make those cframe.example urls to change to www.example.com I would have solved my problem ...

Cheers,

Max

Claudia Kosny

Friday 09 February 2007 8:35:50 am

Hi Max

Maybe I misunderstood the problem, but I don't think that you need two siteaccesses just to use frames. Put the content of the frame with the flash into a special section and override the default pagelayout for this section with a pagelayout that shows only the flash.

The only problem I can see is if someone loads the url of the flash frame directly as they will only see the menu without the default pagelayout. But this is a problem that can always happen when you use frames and can at least be remedied with javascript or usage of cookies.

Don't forget to provide alternative navigation for people (and searchengines) that don't have a flash plugin.

Claudia

Massimiliano Bariola

Friday 09 February 2007 8:56:17 am

hi Claudia,

the 2-siteaccess solution was suggested by someone in that other topic I mentioned, but yes I think that the only way out would be to have a pagelayout which can detect if the frame is displayed or not . I am not sure I did understand your section solution correctly;
I am not really worried about having someone accessing the page of the navigation frame (with no content), but rather of people directly accessing the content frame pages (which are those that get indexed) which would be displayed without navigation flash and thus not navigable, unless I put those provisions in the pagelayout. essentially I get something that does not seem usable for those with javascript disabled.

or maybe I didn't understand you properly? can you explain it a little better?

ciao,

Max

Claudia Kosny

Friday 09 February 2007 11:03:26 am

Hi

Sorry, I was thinking about iframes, not frames. But of course iframes do not solve your problem.

Hmm, for now just a few questions:
Is it possible to send a link to a specific (i)frame using your flash application? (Like the target attribute for a href in html)
Is it possible to send some specific info to eZ with your flash application, preferably by setting a special http referrer? Another, a bit more complicated option would be to submit a form with the link as input field to some custom module instead of making a direct http request.

If both is possible I have a vague idea how to do this.

Claudia

Massimiliano Bariola

Tuesday 13 February 2007 6:05:47 am

Hi Claudia,

sorry for the late reply. I had to act on the usual emergencies of day-to-day work :-)

I will answer in a more detailed manner later ... at the moment I feel oriented towards having the frameset detect whether it exists or not. but will come back with a more detailed implementation.

Ciao,

Max!

Claudia Kosny

Tuesday 13 February 2007 9:18:16 am

Hi Massimiliano

My two ideas did not work out anyway...

I think detecting whether the flash navigation is loaded is not a big problem. You should be able to send either an referrer with a link. If that does not work, submit a small form to a custom module instead of an http request, when someone clicks on the link. Your custom module checks the sent information, sets a session variable that the navigation is there for the link submitted in the form and redirects to the requested module/view.

The problem I see is loading an additional frameset (when the navi is not there) and loading the requested url in the correct frame. This is where I failed with my ideas :-(

Nevertheless here my ideas, maybe they can give you a hint for a working solution.

The first idea:
You have two pagelayouts. One just for the flash navigation. The other one contains two areas, one with two iframes for the navi and the content, the other part just the content itself.
Now your flash navigation sends some info with the link to tell eZ that it is there. If it is there, the second part of the pagelayout is used, as this will display the content to the iframe targeted by the link. If the information is not there, the part of the pagelayout with the two iframes is loaded, which loads the iframe with the flash navi and the iframe with the content.
Unfortunately this does not work at all - you would need to process module result twice because when the pagelayout is loaded with two iframes, it needs to request the content for the lower iframe again.
Another major problem with this approach is what happens when you click on links within the content iframe. I haven' tried it but I fear that you will get another frameset with the navi and the content within the content, which is of course unusable.

The second idea:
Use apache mod_rewrite and an frameset page outside of eZ. The flash navigation again needs to be able to send an referrer or some other information that can be used by mod_rewrite, but is not part of the link. Also, as said before, the navi needs to be able to send links to defined target which is the content frame.

Mod_rewrite checks whether the link was sent from the flash navigation. If yes, the request is forwarded to EZ which returns the requested page in the layout for the content frame. As the link was targeted to the content frame, it appears correctly.
If the link was not sent from navigation we assume that the navi is not loaded and forward the request to the external frameset. This loads the navigation frame and forwards the requested url to the content frame which loads the content supplied by eZ.

Here you have the same problem with frames within frames, so no joy...

Good luck

Claudia

Massimiliano Bariola

Thursday 15 February 2007 3:47:21 am

Hi Claudia,

I think I have found a way to do it :-) I still have to code it but I think it will work.

I will use just one siteaccess.
the pagelayout of that siteaccess will contain an IF statement based on the existance of a cookie that is set when the frameset is loaded.

1) if there is no cookie, it will load the frame, the navigation flash, and will load the page in the content frame. this is possible since the pagelayout has acces to the $request_uri variable. and it will set the cookie.
2) if the cookie is set, it means that I have clicked a link in the content frame, so the links will open in the content frame again.
3) the cookie will obviously be deleted at browser closure.

This should work and google would work properly, I think ... what do you think? :-)

I will put my hands on it as soon as I close another project and will let you know

Ciao Claudia, and thank you for your help (By the way, I should elect you as my guardian angel since you have helped me out with good advice on the GPS/UMTS thing too .. :-) )

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.