TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,019
  • Total Topics: 21,332
  • Online today: 1,232
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 615
  • Total: 616
  • lurkalot

pulling web pages into to the center block thru MenuMgr (or thru Blocks)

Started by iowamf, September 20, 2005, 04:08:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

iowamf

Greetings -

I'm trying to pull external web pages into the center block of the portal (to keep the user w/in the portal) and was wondering if someone has some ideas on how to do this. I'll try to explain my attempts with two examples:

Example #1, in TPADMIN -> Menu Manager:

  I can add a menu of type "link" to index.php/board,1.0.html and it will bring up a forum in the center of the portal - cool.

  If I try to add a menu of type "link" to my_hackpage.html - it brings up the page OK - but the page is not inside the portal - ugly.

  What I'd like to do is bring up the custom "my_hackpage.html" - "inline" or "iframe" (my HTML is not so good). I've been able to do this by embedding "iframe" into articles - but the articles are already in the center of the portal so that is easier.

Example #2, in TPADMIN -> Edit Blocks:

   I've got a block of type HTML that displays a text box form and the results are echo'ed back by an external file "mf_form.php". When mf_form.php is displayed, I'd like to get that to display in the center of the portal (instead, the page comes up as a separate page).

   HTML Block snippet:

<FORM method="POST" action="mf_form.php">
Fill in the text box: <INPUT type="text" name="mytextbox" size="10">
<INPUT type="submit" name="mybutton" value="click me">
</FORM>


   separate webpage "mf_form.php"

<HTML>
<HEAD>
<TITLE>Testing a form</TITLE>
</HEAD>
<BODY>
hello - this is a test <BR>
<?
if (isset($_POST['mybutton'])) {
  echo "You clicked the button\n";
  echo "<BR>You typed <b>" . $_POST['mytextbox'] . "</b> in the textbox.\n";
}
?>
</BODY>
<HTML>


    Notes:
    • SMF1.1 Beta 3 Public
    • inyPortal v.0.6
    • I'm getting a lot better at phpmyadmin when I screw up the GUI so bad I can't use TPADMIN ;-)

    No hurries or expectations.

    Thanks & Regards -

bloc

I would think the thing you need here is an article with support for php. ;) In a block works fine too, but then you need to have other things showing as well. The "frontblock" option will help some(in 0.72 version) but it will not allow multiple, separate pages like the articles.

I am currently looking at adding that option to an article, but not sure if it will go into the next release.

Moocat

i believe you can do this with an iframe. i can't remember exactly what the syntax is for iframes but i believe its <iframe width=# height=# href=url />

iowamf

Actually, I've got it working by embedding HTML into articles already.

My prototype is a local Linux box named "shuttle" and this is an example article:

Portal w/in a Portal:<br> <iframe src="http://shuttle/smf" height="600" width="100%"></iframe>


What is unusual is that if I remove everything before the iframe command, the content of the article always seems to disappear?

The work around is to just put in some free text and a <BR> before the <iframe .

It's pretty bizarre to see a TinyPortal w/in a TinyPortal - but pretty cool too ;-)



iowamf

the iframe in an article works - but it's not great due to having to require some text (see my "Portal w/in a Portal:" text) before the HTML or the HTML disappears (this might be a bug - but it's such a bizarre usage case I hope Bloc ignores it).

A work-around is to embed the iframe HTML into the INTRO text of the article.

The iframe in an INTRO text of an article works fine - but it limits the TPADMIN -> MenuManager -> category link to a single article within a category- but not a bad trade-off. 

The only bad part of this work-around is you get a "Read more ..." link at the bottom of this work-around because it's INTRO TEXT to an article.

I suppose a solution to that would be to have an article with some text that says we hope you enjoyed that page - hit <link> to go back.

This simplicity of this portal system is nice - it makes hacks like this appear as succint features - things working like they should.

Moocat

i'm sure bloc will fix the problem with the text required before the iframe.. his goal is a stable release. then again, this may be fixed with the new wysiwyg editor!

This website is proudly hosted on Crocweb Cloud Website Hosting.