PDA

View Full Version : How to Insert Virtual Include txt. file to IFrame



blueberry
02-01-2006, 03:56 AM
Script: DD IFrame SSI Script II

http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm

--------------------------

Hello, this might be an html question, as related to this script...

We thought this would be the perfect solution to split our extra-long banner page into a few more, and people can toggle them around within one iframe by using text link to each.

Instead of creating new html banner pages, however, is it possible to virtually insert txt. files from the Include directory:

--------------------------

<!--#include virtual="/include/bannerpage1.txt" -->

--------------------------

...just as we are doing now, so that there would be no risk of letting new sub-iframe html pages affect your current good search engine ranking.

When we foolishly replaced the document part with the above command, the page ended up displaying all the txt. files at once (not an iframe at all). Obviously that was not the way to achieve this...

If this could be done, how would you modify “Step 2” of the script:

--------------------------

<iframe id="myframe" src="bannerpage1.html" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:500px; display:none"></iframe>

--------------------------

and the text link to that page:

<a href="javascript:loadintoIframe('myframe', 'bannerpage1.html')">Banner Page 1</a>

--------------------------

Thank you for your help!!!

ddadmin
02-01-2006, 10:38 AM
Well, an iframe simply loads the page referenced in its src property, for example:


<iframe src="dir/page.shtml">

Now, within page.shtml itself, you're free to invoke SSI to then include the text file of your choice:


<!--#include virtual="/include/bannerpage1.txt" -->

Not sure if this answers your question.

blueberry
02-01-2006, 09:29 PM
Thank you for your response,

Unfortunately, for search engine reasons, it might be preferable to load txt files directly into your iframe script (few of them to toggle around), without using html/shtml document containing the txt files.

We would be so grateful if, in other words, the following command could be executed within your iframe script, rather than within an html/shtml page:

----------------

<!--#include virtual="/include/bannerpage1.txt" -->

----------------

So far, this script seems to be the best solution for splitting our extra-long page into a few more, so hopefully this can be done…

Your time is truly appreciated!

Twey
02-02-2006, 09:50 AM
<iframe src="/include/bannerpage1.txt">
Like that? Note the necessity for bannerpage1.txt to be accessible from the web.

ddadmin
02-02-2006, 09:56 AM
Or like Twey says, you're free to directly include a .txt file via SSI includes. As long as it's a text file of some sort, it will work. :)