Developer Forum »
Preview
31 posts

I can't get the preview function to work on a site. When I try to preview an article in edit, I just get the default 404 message "Page is unknown or unavailable." So I updated Webnodes to the latest pre alpha release (v. 1111), and tried different combinations of domains and primary domains, under site settings. But it didn't help. The only thing that seems to work is to turn off the option for "Friendly 404 page" (in Site > Errors). But I would rather not have this turned off, since it will result in an ugly Server Error when a visitor navigates to a page that doesn't exist.

Any ideas?

120 posts

Hi, I'm not sure why this is happening. I'm unable to reproduce the error locally.

Could you email me some details so I can see it live, or send me a site file (debug content is enough).

Ole

58 posts

We're having the same trouble on www.styreinstitutt.no.

The preview-frame has src "/?WAF_Action=Blank" for som weird reason.

Attachments
120 posts

Hi, I've looked at the sites. I manage to repoduce the error if I entered the "/edit" area with an url not starting with "www". Doing this can cause the preview to not function properly.

What happens is that there is set up a primary domain in the site module that redirects all visit requests to the primary domain. This redirect does not happen for the "/edit" area. What we end up with is a preview frame where the domain differs from the surrounding frame, and sometimes this cause javascripts that refreshes the frame to fail, due to cross domain security mechanisms built into the browser.

The quick workaround is to make sure you enter the "edit" mode with a url that matches one of the  primary domains of the site. In the "styreinstitutt"example, use: http://www.styreinstitutt.no/edit not http://styreinstitutt.no/edit

In a furtue update, we'll change the preview so it work as expected regardless of the URL you use. It's high up on the list, so expect a fix for this before 01.10.2011

31 posts

Great! Thanks :)

58 posts

I get the same problem regardless of www. is present or not on styreinstitutt.no.. :(

31 posts

Ahh, yes. Same here. I just turned on "Friendly 404 page" and it doesn't work again. I'll just keep it disabled for now.

58 posts

You have to make sure there is a "default.aspx" file in the root of the site. Make sure the file is not zero bytes, it must have something in it.

31 posts

Worked like a charm!

Thanks for the tip Lars Erik :)

1