Page 1 of 1

Include HTML in the HTML event plugin?

Posted: Fri May 11, 2007 2:08 pm
by randulo
What is the best way to do this?

I have some HTML that is generated regularly, a kind of news recap. Currently, I have added the HTML plugin, manually dump the HTML whenever it changes. This is obviously way too much work :)

What I'd really like is to have a big fat Include() in that plugin. Perhaps I could copy the plugin and modify it so that it does this include instead of the database SELECT? Before I start hacking and kludging, has anyone already done this?

thx, r

Re: Include HTML in the HTML event plugin?

Posted: Fri May 11, 2007 2:57 pm
by garvinhicking
Hi!

You can use the 'externel application' sidebar plugin to include remote/local PHP files to be displayed in a sidebar.

I found out it was not yet in spartacus, but only discussed in this forums here a few times. I just committed it, it's a very simple plugin:

http://php-blog.cvs.sourceforge.net/php ... xternalphp

However you could of course also build up your own plugin that uses your own PHP code inside the 'Generate_content' method, then you don'T need a generic include stuff.

Best regards,
Garvin

Posted: Fri May 11, 2007 6:09 pm
by randulo
Well, the php plugin didn't ever install on my (old version) setup.

What I did is pretty disgusting, but it works. I just replaced the $content= with a readfile("myname.htm"). Very kludgy, I know but it works fine. I never have enough time to do things right, I really should write a plugin that simply allows you to name an HTML file and read it in, what is what my kludge does in one line of php.

I'm terrible, but very time efficient.

r