Hi,
I did a search but couldnt find this documented/discussed anywhere, I appologize if I'm wrong.
Say you have html file(s) on your TP server that gets updated on a regulary basis. You want to present the content of this file when the user press some link in a block in the "sidebar" and the content gets displayed in the "Content Area" / "Body" of the "Home Page".
Possible ?
Read the following:
http://www.w3schools.com/tags/tag_iframe.asp
First...MAN your fast :D
Second....oj!!!! that looks NEAT!!
Now;
The code is:
<iframe
src ="/default.asp"
width="100%">
</iframe>
Two questions:
1) Its possible to replace "default.asp" with "default.html" ? (sorry I dont know the difference betw asp and html :(( )
2) Where can iframes be used within the TP framework ?
You can put just about anykind of file in a iframe. Anything that can be viewed by a browser anyways.
Also, notice the attributes you can add. Say if you wanted to have no borders, then use:
<iframe border="0"
src ="/default.asp"
width="100%">
</iframe>
There are alot of atributes you can use for it. Even no scrolling. However, you can set a Iframe width attribute to 100%, you cannot set the hieght to 100%.
There are javascripts that allow it, but only if the page is in teh same domain as the iframe.
Hey thanks Xarcell!!
Hmm...I seem to recall reading something about having to turn off some WYSIWYG editor to make this work - am I remembering correctly ? If so; where do I do this ??
And; does that mean I would also have to turn it off for regular posting ?
And; where would I find these javascripts that allows for height adjustments ? (My first two iframes will most likely be located on same domain)
If your using v7 of TP, then yes. I recommend you turn it off. However, if your using v8 of TP, it should work fine.
Be sure to add the height="###" attribute to your iframe.
If you need anymore help let me know.
Thanks again Xarcell!!
I'm using:
Powered by SMF 1.1 RC1.
Oxygen / TinyPortal v.0.75 by BlocStill a few unanswered questions:
* Where can iframes be used within the TP framework ?
* Will turning the WYSIWYG editor off, also affect regular posting in the forum - or just articles etc?
* You said:
QuoteHowever, you can set a Iframe width attribute to 100%, you cannot set the hieght to 100%. There are javascripts that allow it, but only if the page is in teh same domain as the iframe.
where would I find these javascripts that allows for height adjustments ?
You can use iframes in the theme, articles, or blocks.
WYSIWYG editor only effects what you write for articles.
http://dynamicdrive.com/dynamicindex17/iframessi2.htm
Is the page your wanting to put in a article have links in it to other pages? If not, there is a better method than iframe.
In an article using php, this may work:
<?php
include('the name of page.html');
?>
Thanks again Xarcell, really appreciate it!
One of the pages has MANY links in it, the other page has none. What is the other way of doing it ?
Hahaha this r0x !!!!
I just iframed this HUGE html file with tons of info (it did time out tho once) but when I refreshed it displayed it just nicely, and with the java-fix even nicer lol
THANKS !! :D
I'm still curious about that other way of doing it tho (when there's no links in the page thats gonna get iframed) - perhaps its possible in a block ?? (there's not much text in that file)
That other way is better, only if the links open in a new window I think. I haven't tested it to see if clicking a link loads it in-itself.
You can always make one of each and see what happens.
Adding
<?php
include('myhtmlfilehere.html');
?>
to a phpbox block I get
Parse error: parse error, unexpected '<' in /home/evanss/public_html/Sources/Load.php(1598) : eval()'d code(32) : eval()'d code on line 1
You do not need the <?php or ?> in the phpbox. All you need is the include line.
aaaaaahh, ya...
Silly me.
Hmm...that didnt work all that well. I just got the title of the block and no text below it.
And the weirdest thing....I have this html block where I have 3 links:
<a href="index.php?action=chat">Chat here!</a>
<a href="index.php?page=10">Chat statistics</a>
<a href="index.php?page=13">Who's online now?</a>
Where the two last is "iframe-phparticles". Page10 is using the java-script and iframe that Xarcell tipped me about, and it works SO beautifully! So I copy/pasted the code from this one into my text-editor, search/replaced the iframeid and pasted it into a new php-article. But for some odd reason I get:
Parse error: parse error, unexpected '<' in /home/evanss/public_html/Sources/Load.php(1598) : eval()'d code(76) : eval()'d code on line 1
???
Edit: typos
there is a singel ' in the line. this must masked ..
your code
<a href="index.php?page=13">Who's online now?</a>
change to
<a href="index.php?page=13">Who\'s online now?</a>
Fel
Hmm...then I got this:
(notice the the html-block is on right side: "Who\'s online now?")
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.federationofkings.com%2Ffiles%2Ftemp%2FImage7.jpg&hash=bc46bd851497e418e5d9dea6971ee45ab71f6bdf)
If I use the iframe or the php: include('myhtmlfilehere.html'); it gives this error, if I however change it to:
<a href="/files/irc/whosonafk.html">Who's online now?</a>
it works fine ???
Quote from: fenris_w0lf on January 25, 2006, 12:21:14 PM
<a href="index.php?action=chat">Chat here!</a>
<a href="index.php?page=10">Chat statistics</a>
<a href="index.php?page=13">Who's online now?</a>
is that in a php block?
by this .. you must that enclose in
echo ' ... your code ..
... more ..
';
and the links ..
in php normly is to use $scripturl
so like
global $scripturl;
echo '<a href="' . $scripturl . '?action=chat">';
Fel
Thanks Feline for the effort!!
The three lines is in a html block not php.
nah...I'm lost, could this be some sort of bug or something ?
iframes arent really accepted as a php article now is it ? :(
well...atleast I learned something...
:D
...weird it works for one article, but not the next..the articles were identical except - as mentioned - the iframe id ???
The simplest way would be to do something like echo file_get_contents(url);
You can do that for any file anywhere.
Thanks for that tip eldacar :)
edit: The parse error problem I was partly using non-php code in php articles and partly due to not removing the "<?php" and "?>"
*blush*
Try this inside a php block fenris_wolf
echo '<a href="index.php?action=chat">Chat here!</a><br />
<a href="index.php?page=10">Chat statistics</a><br />
<a href="index.php?page=13">Who\'s online now?</a>';
The problem never was this html block:
<a href="index.php?action=chat">Chat here!</a>
<a href="index.php?page=10">Chat statistics</a>
<a href="index.php?page=17">Who's online now?</a>
It works just fine. The problem was the articles (page10 and page17 that is linked in the html block above.
Its working fine now. The problem was that I had php articles and used the "<?php" and the ending "?>" - without them it works fine.
Ahhh ok...
Trust me to misunderstand it like the big ol dumbum i am..... :P