Home
TeamSite
Refresh preview browser window
ela
In the old days, with TS 4.5.1, the users could click the refresh button in their browser window to refresh their preview page, after changing their DCR (templating form). Does anyone have a solution on how to achieve this in 5.5.2? One of my brain cells told me the question had been posted here before, but searching for "preview" or "refresh" didn't bring up the desired results.
Regards,
Eldbjoerg
Find more posts tagged with
Comments
Adam Stoller
Depending on the browser - hitting something like Ctrl-R or the F5 key usually does the trick. You might have to respond to a dialog box that informs you that it will have to reload the data - but otherwise I believe that should do the trick. Or am I misunderstanding your question?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
ela
I believe you misunderstood me, unless you're still on TS 4.5.1;-) - which I'm sure you're not.
Here's the situation: a user edits her content, brings up a preview html file by clicking the preview button in the templating form. Then she does some more editing, but instead of clicking the preview button again she wants to simply refresh the former browser window to preview her changes. The standard browser refresh button, Ctrl-R or F5 doesn't do the trick alone. The Preview button in the form has to be clicked before the preview zz file gets updated. I just wanted to know if there's a way to automate this process? Can it be achieved by for instance generating some javascript functionality with the presentation template?
Eldbjoerg
Adam Stoller
Oh - no - I think you have to click the preview button because you need to re-run iwgen, the output of which will probably go into a different [set of] file
and then be displayed. The only way I could see automating it would be to somehow provide a button in the generated output that invoked the exact same command that clicking on the Preview button within the TS GUI does - and still you'd probably end up with a new window because you would be looking at a new file.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
ela
Thanks a lot for the quick replies, fish!
Yes, I thought about something like a button, so if somebody has tried it out already, I'd be happy to hear from you!
Happy Easter!
Eldbjoerg
Migrateduser
You might want to reread Ghoti's response. You MUST press the preview button to have the zz_* temp file regenerated and thus update the preview.
- Jason
ela
thanks, but I understood what he meant. It doesn't mean there isn't any other solution. I just wanted to keep the option open to hear from others who might have succesfully implemented something like that.
Migrateduser
> I just wanted to keep the option open to hear from others who might have succesfully implemented something like that.
Something like what? A button? There is a button... It comes out of the box and says "PREVIEW" on it. What is your question? If your question is, "Can I just press the browser's refresh button and have preview update automatically with newly saved changes?" The answer is no. If that's not your question, please explain what your question is because I for one am having a hard time figuring out what you want to know how to do.
- Jason
Migrateduser
I have something that does something like this (basically the TPL checks if it's running in preview mode and if so redirects to a CGI that does the generation and then reads/writes the generated file, so when they refresh the CGI URL they will regen (maybe with a repost warning from the browser)) but I am not sure the customizations are worthwhile. If this is really important I can give you some more detailed ideas.
ela
Hi John,
sorry for not responding before. Your solution sounds very good to me, so I would appreciate it very much if you could be so kind to provide some more details. Either post it here or send me an email:
eldbjoerg.lamvik@mobi.ch
.
To Jason: the users don't like that the preview file opens in a new window every time they hit the preview button. They can of course close the preview window every time as well, but they would rather not have to do that. You may call it lazyness, but I'm dealing with users who aren't very happy with the product in the first place, so anything which can reduce the amount of clicks is useful.
Thanks!
Eldbjoerg
Adam Stoller
Just a thought - completely untried - but if there is a CCI link for previewing a file - you might be able to have your PT include a self-referential preview link when generating for preview (there's be example code posted before about how to determine if you're generating for preview or not). If the CCI exists, you could format it either as a link or even probably as a button.
If you try this out and it works - please post the code (or better yet, turn it into an article and enter it through the new contribution mechanism on the Tech Library page).
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
I'm pretty busy at the moment but I can provide more details later. Regarding the new browser window issue, I remembered a setting in iw.cfg that would reduce the number of new windows (I think if you pressed preview on the same DCR again it would reload in the same window instead of always opening a new one), but it didn't have much impact (previewing multiple DCRs would still open multiple preview windows).
[iwcgi]
## If you want to target a single browser window for
## file previews, flip this to true.
single_browser_window=false