How to run CodeIgniter app in Joomla 2.5? - php

We have some apps developed in a single installation of CodeIgniter, where each controller is a different app.
We need to make it so that when a certain Joomla 2.5 article is loaded, it runs the CodeIgniter app, gets the resulting html from it, and shows it on the Joomla 2.5 site where the article would be loaded.
Some more useful information: the apps contain forms, which work via post.
Update: I tried opening an <iframe src="localhost/myapp/mycontroller/"></iframe>in the article html editor, but it seems it doesn't allow that. The iframe just disappears.

Okay so I found a solution. Not very elegant or convenient at all, but it allows me to do what I want to do.
I used the following code on the Joomla article:
<h1>Hello</h1>
<iframe src="http://localhost/" name="myiframe" width="600px" height="400px"></iframe>
However, the built-in Joomla editor doesn't allow iframes to be used on an article. It just deletes them. To get around this, I used phpMyAdmin to browse through the Joomla database.
I searched the prefix_content table for the article I wanted, and manually edited the row for that article, typing the html code in there.
The resulting iframe can now retain all the functionalities of CodeIgniter, and is nicely isolated into the iframe.
Like I said, not an elegant solution since I needed to alter the database directly, but there might be a Joomla extension around that allows iframes to be used.

There are tons of plugins in the JED.
Here's an exemple :
http://extensions.joomla.org/extensions/style-a-design/popups-a-iframes/16450?qh=YTo0OntpOjA7czo2OiJpZnJhbWUiO2k6MTtzOjc6ImlmcmFtZXMiO2k6MjtzOjc6ImlmcmFtZWQiO2k6MztzOjg6ImlmcmFtZSdzIjt9

Related

How to find function and HTML code in wordpress

Normal when i try to customise WP style i would use inspector view in Chrome and this would allow me to locate style code easily.
i was wondering how i can do the same for HTML or PHP code in WP such as plugins and the CMS it self?
Thank you
PHP is server side code and can't be found in the browser. If you want to see the code for WP plugins then you'll need to either download the plugin to your local machine or view the files on the server hosting WP.
Iassume you run it on your own root-/ webserver,...
so if you want to add HTML Elements to a post or site just do it in the text few like you would in an HTML-Editor like for some link thing for instance (you should allready know that..'pretty shure it also works for js).
However if you want to customize the way every page on your blog looks, you can also do this manually, but it won't be as easy.
There should be a section under the theme customization part where you could upload your own css and php (at least with a lot of styles it's like that).
I WOULD NOT mess with the files on your server, if you don't know what you are doin, cause - to be honest - you can make a great blog/ website by using the tools it gives to you. ;)
I recommend using the stylesheet from your wordpress theme for a custom HTML-document based on the source of a blog page, if you go for the looks... and in every other case just use plugins! :P

Can an `<iframe>` hold multiple pages inside of it?

I am creating a Wordpress plugin that if possible, I would like to link to a series of pages to an outside website (an affiliate login), instead of re-building a replica of the same pages inside of the plugin.
My thought was to do this inside of an <iframe>, but since there are several pages, I do not know if this is possible, or if it's even a good idea for other reasons.
I'm thinking it might be better to re-build the pages inside of the plugin. It sounds like there could be a ton of problems trying to do it with an <iframe>.
a single iframe can only point to a single source - so make that source have several iframes instead - make a new html file in your plugins folder
like yourdomain.com/path_to_your_plugin/new_iframe_holding_file.html
in that file put as many iframes as you want show up in your plugin and in your plugin code point the src property of your iframe to that file

Joomla 3.0+ Create PDF from HTML content

So I am trying to convert a certain type of page view into PDF (and also CSV's but thats another hurdle). The tricky part is that I am using Joomla 3.0 so the ever popular PhocaPDF extension will not work.
So far I have tried using http://docs.joomla.org/Creating_PDF_views, but it ends up throwing errors when referring to JRENDER().
Also I have tried using this extension
http://rootprogress.com/index.php/downloads/root-pdf-content
Which I can get to work but only for the article view. I can tell that this plug-in gets its code using DOMPDF and also grabs the $article from JOOMLA! so I have no idea where it is grabbing the $article variable from (so I can reassign it to my new view).
Has anyone had any success with implementing a PDF generator in Joomla 3.0?
The PDF functionality that used to be there in V1.5 was removed in V1.6, see Changes from 1.5 to 1.6. I don't think anybody put it back in for later versions. You can use a third party component if you really need it.
Joomla 3.3 has the option to print articles, you have just to enable it.
Then if you're browsing with Google Chrome you can easily print the page as PDF.

Inline Editing (mojomotor like) for Code Igniter project?

So I've built my site in Code Igniter and there are a number of pages where I feel it'd be easiest if the client could edit the content inline - much like what MojoMotor offers.
I'm not interested in using mojomotor but I wondered if anyone had done anything like this for their code igniter project?
As an idea of how it could work:
I was thinking that the client admin user could login to the normal custom built admin CMS area. After logged in, with session set, they can browse out to the public site for selected pages.
These pages will have a check for that admin session built in and if it's present, it can include a js file, which will overlay an admin banner and somehow enable the fields (perhaps content divs with a certain id or class relating to the corresponding table/field in DB) for editing.
--EDIT--
I've seen quite a few js inline editors around. I guess my confusion is over how best to integrate them with my database and controllers - i.e. idea of having the div id/class somehow map to the db field.
The bottom line is that MojoMotor is a CodeIgniter app and not a library. Therefore trying to work the code into your existing CodeIgniter project is not really an option.
But if you're willing, you can integrate your CodeIgniter project into MojoMotor and have the benefits of both. Here is a series of articles written on how to do this.
This is one example of the code you are looking for . You'll have to adapt the method for use with CI

Open page in Joomla

I'm using Jumi to echo php code and then showing that in a Joomla Article, and everythings working fine. Now I want to do this:
The output is basically a list from a database like this:
Name Price Type
A 1 T1
B 2 T2
In this list I want to include links to only show items of the same type, so "T1" would like to a page only showing things of type T1. So I thought I would do this by making a new page that takes a type and then get all the items of that type from the database. Without Joomla this wouldv'e been a piece of cake, with Joomla I'm not quite sure where to begin.
How should the a href=... tags in the html code printed by my php script look?
Is my basic structure still correct, and if so, how do I make Joomla open the new page in the normal frame and not replace the whole Joomla page. some kind of target-frame attribute?
EDIT:
I know I should be using a component instead, however I just need to get this working before going on vacation in three days. I will do it properly when I get back.
I don't mind if the entire page reloads, what I do need is the Joomla menu, header-banner and other things around the page to be loaded as well. If I just use a href=mypage.php I assume the header and everything around it will disappear.
I think you are going about this all wrong. You shouldn't be using Jumi to run php in your articles. You should design a component. Although this will take a tiny bit longer to setup initially it will save you time in the long run and prove to be much more flexible than using Jumi in a single article. Have a look here on how to create a Joomla component - http://www.joomladevuser.com/tutorials/components.
a href= tags should not be any different from any other html you have ever used.
E.g. echo 'link';
To make just the frame/div/table/etc reload rather than the entire page you will need to implement some AJAX. I have answered a question on how to do this with Joomla components before, see here: how to use Jquery AJAX in Joomla Components?

Categories