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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 777
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 87
  • Total: 87

Guide to using an Article to display WP with an IFrame

Started by kfrost, March 12, 2009, 02:34:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kfrost

Hello,

I've spent the afternoon trying to figure out how to add a Tab called blogs to my forum and when clicked I'd like to display my blog site in the center panel.  I found the long TP thread and the IFrame code.

I found a How To on creating articles but seems dated because it talks about being able to create static, contect etc.  I'm using SMF 1.1.8 with TP 1.0 Beta 3.  www.carolinaTechTalk.com

As you see I have a Blogs tab created and I created an HTML article and added the IFrame code to.  But I'm not having much luck past this.

Is there a how to guide on creating an article the proper way and then editing the index.template.php file so when the brower button is clicked, WP shows in the center panel?

Thanks


Ken.

Hi kfrost, welcome to TinyPortal.

If you've read the topics here on TP about iFrames then you probably already know about as much as anyone else about them.

For my WP page I use the code from one of those topics in an html article and it works reasonably well.

What is your exact problem at this time? Doing the article, or linking the button?
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

kfrost

Hello Ken,

Thanks for the welcome.  I would say I'm having problems with a little of both.  Steps I've followed.  There is an article about adding tabs,

http://docs.tinyportal.co.uk/index.php/topic,30.html

with that along with a comment from Crip, I've got the Blogs Tab showing in TP.  www.carolinaTechTalk.com 3rd tab from the left.

I added this to the index.template.php to accomplish the tab appearing. 


if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'blog')))
$current_action = $context['current_action'];



The next part I'm pretty positive is a problem area.  It's setting the reference to what should open when the Blogs tab is clicked.



// Show the [blog] button.
echo '<li><a' , $current_action=='blog' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=Blogs"><b>Blogs</b></a></li>';




As for the article, I created HTML article and I pasted the code from the TP post into the top editor under Title.  The odd thing I've noticed is sometimes I paste the code in and click save my blog shows up here.  But there doesn't appear to be a way to edit the code anymore.  The window showed up small when I opened the article directly so I tried resizing and saved and the code is gone.  Sometimes I get the error web page isn't found.

But yes, the main problem now is wiring up the Blogs Click event to show an article with this code in it.  If you go to the site right now and click Blogs, it loads up the Forum instead of this article I've created to load the Blog website.

Thans.

G6Cad

Change action=Blog to action=blog

PhP code is case sensitive and also, you define the first action to blog and the other to blogs

They need to be same all the way

kfrost

Thank you G6,

But how does me setting the action to blog in the index.template.php indicate that when it's clicked it should open a specific article?  Do I have to make the title of the article read blog as well?
Currently the title of the article reads as Blogs.  Also, I've played around with using different things for the action.  I just have it as Blogs now because again that's the title of the article.  I'll state this again, I know Zero about PHP.

It seems as if there is a condition somewhere I need to define what the action blog should do.  It's also puzzling that even though I do have the action wrong, that when you click the Blogs Tab it's opening up Forums.

Renegd98

Instead of ?action=blog

it should be ?page=xx

where xx is the article you want opened.

Ken.

The path for the button should be to the article and not be to the blog.

Example:
"http://www.ourfamilyforum.org/FamilyForum/index.php?page=73"
...or... "?page=73"

EDIT: Ya beat me Renegd98!  :o
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

Zetan

You can also use a "Query" title for the Article, that once set.. you can link to the article using either:

?page=xx , "xx" being the actual article page number

or

?page=articletitle or, in your case: ?page=blogs

kfrost

Thanks everyone, that definitely gets me a step closer.  I'm going to post what's going on so the next person trying to do this can follow along.

FYI.  If I try to make any modifications to the article and click save, it completely removes the code related to the iFrame I put in.

Also, very sporadically the link I put in the src="" will actually work.  Sometimes I'm getting page not found but if I view source and paste the URL I have for the blog site into another browser, it comes up fine so not sure what's going on there.

Also, it seems that you also have to add the article to a category.  Because until I did I got an error that the article was either missing or in active but I made sure the active radio button was selected.

Right now I'm at the point to where the article is showing up.  However, it overlays the left and right panels.  Also, the code I pasted in the article is displaying instead of the Blog website.  I'm not sure what's causing this but it seems if I keep deleting the article and creating a new one eventually it will work.

Another question, is how would I know what page number the article is? 

Thanks.

P.S.  I closed down my browser and opened up the site again.  If I go into Manage articles, and open the blogs article, now the blog webpage shows up there correctly.  However, if you click on the blog tab, I still only see the script I added spewed out in the page as text instead of the blog site


Ken.

kfrost, TP v103b has an issue with the editor, so you need to turn it off or do the fix that Bloc posted in this post:
http://www.tinyportal.net/index.php/topic,28788.msg229572.html#msg229572

As for the panels... in my experience it's best to have TP side panels turned off while WP is displayed in an article because WP wants lots more space than is available when they are on.


QuoteAlso, very sporadically the link I put in the src="" will actually work.  Sometimes I'm getting page not found but if I view source and paste the URL I have for the blog site into another browser, it comes up fine so not sure what's going on there.
You will likely need the full url, including the 'http'.

QuoteAnother question, is how would I know what page number the article is?
The number should be visible in your browser address window when the article is open.
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

This website is proudly hosted on Crocweb Cloud Website Hosting.