Include HTML in the HTML event plugin?

Creating and modifying plugins.
Post Reply
randulo
Regular
Posts: 141
Joined: Thu Jul 21, 2005 10:28 am

Include HTML in the HTML event plugin?

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Include HTML in the HTML event plugin?

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
randulo
Regular
Posts: 141
Joined: Thu Jul 21, 2005 10:28 am

Post 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
Post Reply