Load page from another |
Load page from another |
Chris Knight |
Nov 16 2010, 04:35 PM
Post
#1
|
Group: Members Posts: 8 Joined: 16-November 10 Member No.: 13,159 |
I have a user that uses excel. This user is able to save and publish this excel page as an .htm file to a share point location. Basicly, there is an .htm file that gets updated throughout the day.
We have a flat screen monitor hooked to a PC in our small office that I would like to display this .htm file on as auto-refreshing. Kinda like an airport screen. I have a separate .htm file that is on the desktop of this monitor PC that looks like this: --------------------------------------------------------- <html> <head> <title>Schedule</title> <meta http-equiv="refresh" content="15" > </head> <body bgcolor="#221e1f" text="#ffffff"> <center> <IFRAME SRC="http://companyweb.asdf.local/General%20Documents/testFolder1/Book1.htm" frameborder="0" style="background-color: #ffffff" WIDTH="1200" HEIGHT="1200"> </iframe> </center> </body> </html> ------------------------------------------------------ This works, refreshing every 15 seconds! My problem is that the text on the screen is too small. I have tried to use < font > tags but it wont change the size inside the iframe. I'm not too experienced with HTML CTRL + in the browser does funky things and the page isn't centered. Question: Is there a different way to self refresh the file, loading the share point .htm into the body on the desktop .htm so I could change font size? Thanks, Chris This post has been edited by Chris Knight: Nov 16 2010, 04:40 PM |
Darin McGrew |
Nov 16 2010, 05:31 PM
Post
#2
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
Please see the FAQ entry How do I include one file in another?
You could also just change the settings (font size, minimum font size) of the browser that displays on your flat screen monitor. |
pandy |
Nov 17 2010, 02:16 AM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
You need to change the font size in Book1.htm alternatively and better link it to a style sheet. Is it possible for the person who creates the page to open it in a text editor and add one line to it, the same line each time?
|
Christian J |
Nov 17 2010, 10:09 AM
Post
#4
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
You can add CSS to the framed page manually at the same time it's created from the Excel file, like pandy suggested, but maybe that creates too much extra work in the long run?
You could also include the framed page's content into the parent page (which then lets you style all of it from the parent page), like Darin suggested, but that requires that your local server creates the parent page (using e.g. PHP or SSI). A third possibility might be to inject styling into the framed page from the parent page with javascript Edit: the example only works in Opera. |
Chris Knight |
Nov 17 2010, 11:03 AM
Post
#5
|
Group: Members Posts: 8 Joined: 16-November 10 Member No.: 13,159 |
Please see the FAQ entry How do I include one file in another? You could also just change the settings (font size, minimum font size) of the browser that displays on your flat screen monitor. Yeah, I tried to modify the browsers font size bit the iframe remains unaffected. Your link helped a bit but dont I need to have both pages on the server to do SSI? |
Chris Knight |
Nov 17 2010, 11:05 AM
Post
#6
|
Group: Members Posts: 8 Joined: 16-November 10 Member No.: 13,159 |
You need to change the font size in Book1.htm alternatively and better link it to a style sheet. Is it possible for the person who creates the page to open it in a text editor and add one line to it, the same line each time? Thank you all for the replies. The issue with changing the font size in book1.htm is that this file gets overwritten every few hours with a new, published book1.htm. The person saving this file is not going to be able to edit HTML... Hmmm... |
Chris Knight |
Nov 17 2010, 11:07 AM
Post
#7
|
Group: Members Posts: 8 Joined: 16-November 10 Member No.: 13,159 |
You could also include the framed page's content into the parent page (which then lets you style all of it from the parent page), like Darin suggested, but that requires that your local server creates the parent page (using e.g. PHP or SSI). This sounds like what I want but I don't know how to do it. I dont know how to CSS. I think PHP is out of the question. |
Christian J |
Nov 17 2010, 11:46 AM
Post
#8
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
A third possibility might be to inject styling into the framed page from the parent page with javascript Think I got the linked example to work now. Of course the framed page must load before the script is allowed to run: CODE <iframe src="popup.html" name="frame1"></iframe> <script type="text/javascript"> window.onload=function() { var cssLink = top.frame1.document.createElement("link"); cssLink.href = "style.css"; cssLink .rel = "stylesheet"; cssLink .type = "text/css"; top.frame1.document.getElementsByTagName('head')[0].appendChild(cssLink); } </script> |
Christian J |
Nov 17 2010, 11:52 AM
Post
#9
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
I dont know how to CSS. That shouldn't be too hard, see http://htmlhelp.com/reference/css/quick-tutorial.html If the framed HTML document contains lots of junk code (not unlikely if it's generated by a Microsoft program) it might be tricky to style, though. If so please post a sample of the HTML and we'll try to help (this might be more appropriate in the CSS forum). |
Christian J |
Nov 17 2010, 12:16 PM
Post
#10
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
You could also just change the settings (font size, minimum font size) of the browser that displays on your flat screen monitor. This is probably the best idea, except that it apparently breaks the page's layout. Maybe using a minimum font size (found in at least Opera and Firefox) will break the page less than enlargin all fonts. Now I also remember that at least MSIE and Opera let you create user style sheets on your own computer to style web pages with. This post has been edited by Christian J: Nov 17 2010, 12:29 PM |
Darin McGrew |
Nov 17 2010, 01:10 PM
Post
#11
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
The last time I used MSIE (about 3 years ago), it didn't support a minimum font size, but it did support an "ignore document font sizes" feature.
Safari has a minimum font size feature. And Chrome has a minimum font size feature, but (at least in the Mac version) you have to edit configuration files by hand to use it because there is no preferences UI for it. |
Chris Knight |
Nov 18 2010, 08:59 AM
Post
#12
|
Group: Members Posts: 8 Joined: 16-November 10 Member No.: 13,159 |
Think I got the linked example to work now. Of course the framed page must load before the script is allowed to run: Well.. I have changed the browser font size (which only seems to work in IE) and it makes the font look weird/cut off in the html. I have done this: In a new folder on the Desktop I have schedule.htm and style.css. Schedule looks like this: CODE <html> <head> <title>Schedule</title> <meta http-equiv="refresh" content="15" > </head> <body bgcolor="#221e1f" text="#ffffff"> <center> <iframe src="http://companyweb.asdf.local/General%20Documents/testFolder1/Book1.htm" name="frame1" frameborder="0" style="background-color: #ffffff" WIDTH="1200" HEIGHT="1200"></iframe> <script type="text/javascript"> window.onload=function() { var cssLink = top.frame1.document.createElement("link"); cssLink.href = "style.css"; cssLink .rel = "stylesheet"; cssLink .type = "text/css"; top.frame1.document.getElementsByTagName('head')[0].appendChild(cssLink); } </script> </center> </body> </html> The style.css in the same folder on the Desktop looks like this: CODE body {font-size:110%;} h1 {font-size:2.5em;} h2 {font-size:1.875em;} p {font-size:0.875em;} I cant seem to get this to work... A little help? Thanks, Chris |
Christian J |
Nov 18 2010, 12:33 PM
Post
#13
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
Well.. I have changed the browser font size (which only seems to work in IE) Firefox also lets you "zoom text only". Even better might be its minimum font size (in the advanced font options) but I haven't tried it. QUOTE and it makes the font look weird/cut off in the html. Sounds like the framed page uses a fixed layout, with no room for enlarged text? Please post the HTML of the framed page. |
Chris Knight |
Nov 18 2010, 01:15 PM
Post
#14
|
Group: Members Posts: 8 Joined: 16-November 10 Member No.: 13,159 |
Well.. I have changed the browser font size (which only seems to work in IE) Firefox also lets you "zoom text only". Even better might be its minimum font size (in the advanced font options) but I haven't tried it. QUOTE and it makes the font look weird/cut off in the html. Sounds like the framed page uses a fixed layout, with no room for enlarged text? Please post the HTML of the framed page. OK... This is a sample of what we are trying to do. This HTML was created by clicking "Save As" in Excel and choosing .htm CODE <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <meta name=ProgId content=Excel.Sheet> <meta name=Generator content="Microsoft Excel 12"> <link rel=File-List href="Book1_files/filelist.xml"> <style id="Book1_10514_Styles"> <!--table {mso-displayed-decimal-separator:"\."; mso-displayed-thousand-separator:"\,";} .xl1510514 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} .xl6310514 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:0; mso-number-format:"Short Date"; text-align:general; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} .xl6410514 {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:0; mso-number-format:"Short Time"; text-align:general; vertical-align:bottom; mso-background-source:auto; mso-pattern:auto; white-space:nowrap;} --> </style> </head> <body> <!--[if !excel]> <![endif]--> <!--The following information was generated by Microsoft Office Excel's Publish as Web Page wizard.--> <!--If the same item is republished from Excel, all information between the DIV tags will be replaced.--> <!-----------------------------> <!--START OF OUTPUT FROM EXCEL PUBLISH AS WEB PAGE WIZARD --> <!-----------------------------> <div id="Book1_10514" align=center x:publishsource="Excel"> <table border=0 cellpadding=0 cellspacing=0 width=267 style='border-collapse: collapse;table-layout:fixed;width:200pt'> <col width=75 style='mso-width-source:userset;mso-width-alt:2742;width:56pt'> <col width=64 span=3 style='width:48pt'> <tr height=20 style='height:15.0pt'> <td height=20 class=xl1510514 width=75 style='height:15.0pt;width:56pt'>Date:</td> <td class=xl1510514 width=64 style='width:48pt'>Who:</td> <td class=xl1510514 width=64 style='width:48pt'>Where:</td> <td class=xl1510514 width=64 style='width:48pt'>when:</td> </tr> <tr height=20 style='height:15.0pt'> <td height=20 class=xl6310514 align=right style='height:15.0pt'>11/28/2010</td> <td class=xl1510514>john</td> <td class=xl1510514>location A</td> <td class=xl6410514 align=right>12:00</td> </tr> <![if supportMisalignedColumns]> <tr height=0 style='display:none'> <td width=75 style='width:56pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> <td width=64 style='width:48pt'></td> </tr> <![endif]> </table> </div> <!-----------------------------> <!--END OF OUTPUT FROM EXCEL PUBLISH AS WEB PAGE WIZARD--> <!-----------------------------> </body> </html> This post has been edited by Chris Knight: Nov 18 2010, 01:21 PM |
Christian J |
Nov 18 2010, 07:32 PM
Post
#15
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
OK... This is a sample of what we are trying to do. This HTML was created by clicking "Save As" in Excel and choosing .htm There are some fixed font-sizes, widths and heights in that table. Try overriding them by adding the following to the stylesheet with the font-sizes: CODE table, col, tr, td { font-size: 100% !important; width: auto !important; height: auto !important; } |
Chris Knight |
Nov 18 2010, 09:02 PM
Post
#16
|
Group: Members Posts: 8 Joined: 16-November 10 Member No.: 13,159 |
OK... This is a sample of what we are trying to do. This HTML was created by clicking "Save As" in Excel and choosing .htm There are some fixed font-sizes, widths and heights in that table. Try overriding them by adding the following to the stylesheet with the font-sizes: CODE table, col, tr, td { font-size: 100% !important; width: auto !important; height: auto !important; } Thank you for the attempt. I don't think the style.css is being loaded. Is there a way to include the style.css code into the main .htm file? I did add your code to the style.css, but it didn't affect anything. |
pandy |
Nov 19 2010, 04:36 AM
Post
#17
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
QUOTE Thank you for the attempt. I don't think the style.css is being loaded. The latest addition created a kludge of text in my gecko, so you should at least see that. I notice you use the full URL to the framed page. Is it on another domain than the main page? Christian, I'm not good at this, but wouldn't it be possible to remove the old style block to start with (with JS) and start fresh with the injected style sheet? Ideally one would also nuke the office junk, but I guess that's harder. |
Chris Knight |
Nov 19 2010, 06:54 AM
Post
#18
|
Group: Members Posts: 8 Joined: 16-November 10 Member No.: 13,159 |
Is it on another domain than the main page? Good morning! All this is happening on 1 local subnet. We have 1 small business server where the user uploads the .htm (from the excel file) to a share point location. Which is: http://companyweb.asdf.local/General%20Doc...lder1/Book1.htm The original code and all forum assisted code is being run from the desktop of the large monitor PC. So I have a folder on the PC desktop with the schedule.htm and the style.css in that folder. Thanks, Chris |
Christian J |
Nov 19 2010, 07:36 AM
Post
#19
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
Christian, I'm not good at this, but wouldn't it be possible to remove the old style block to start with (with JS) and start fresh with the injected style sheet? Yes that's a good idea. Try: CODE window.onload=function() { // remove all existing STYLE elements. var style=top.frame1.document.getElementsByTagName('style'); while(style.length>0) { top.frame1.document.getElementsByTagName('head')[0].removeChild(style[0]); } var cssLink = top.frame1.document.createElement("link"); cssLink.href = "style.css"; cssLink .rel = "stylesheet"; cssLink .type = "text/css"; top.frame1.document.getElementsByTagName('head')[0].appendChild(cssLink); } But note that there are some inline styles in the table, that must still be overridden like in my previous post. QUOTE Ideally one would also nuke the office junk, but I guess that's harder. True. |
Christian J |
Nov 19 2010, 07:45 AM
Post
#20
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
The original code and all forum assisted code is being run from the desktop of the large monitor PC. So I have a folder on the PC desktop with the schedule.htm and the style.css in that folder. That doesn't work. For security reasons browsers only allow scripting between framed pages on the same domain. Your computer's file system (including your desktop) is not the same "domain" as your server http://companyweb.asdf.local/ --to make it work you must serve the parent page schedule.htm from the server too. |
Lo-Fi Version | Time is now: 24th April 2024 - 10:54 PM |