Server side include

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
11/2/2005 8:26:21 AM
Gravatar
Total Posts 29

Re: Server side include

Hi Joe, First of all, thanks for making mojoportal available. I am currently using it for my personal web page at http://www.mayrhofer.eu.org (still work in progress, not too much content there right now) and the setup was mostly painless. I still have troubles with mono 1.1.9, but as already reported in the forum, this seems to be a bug on their side. What I'd like to add as a feature request is a "server side include" module, which basically just includes a (incomplete) HTML file from the file system. It should behave roughly like the Html module, but instead of fetching the content from the database, just take the configured file (and of course the editor is not necessary, a simple field to select the file name would be enough). The reason for this is that there are a lot of tools that are already able to create HTML files without and tags and which can therefore be included inside a web page. My personal need is to include my list of publications directly in the page instead of linking to an external HTML file. And since that file is automatically generated outside of mojoportal, cut&paste into the Html module is not really feasible. Another option would probably be to modify the database and update the HTML content there, but I suppose the server side include is simple enough if you know the code ;-) with best regards, Rene
11/2/2005 8:36:21 AM
Gravatar
Total Posts 29

Re: Server side include

Hmm, it seems that html tags are not escaped in here.

In my last post I was refering to ‹head› and ‹body› tags which can be omitted in the generated HTML files.
11/2/2005 1:51:13 PM
Gravatar
Total Posts 18439

Re: Server side include

That sounds like it would be very easy to implement but not sure when I will get to it from a priority point of view. Sounds like you are trying to avoid the copy paste effort so I'm guessing you must have a lot of files and that would be tedious. Not sure I can help you on that in the short term but I'll try and get to it sometime. It does sound like it would make it easy to integrate content from other content management systems.

Joe
11/2/2005 3:24:42 PM
Gravatar
Total Posts 18439

Re: Server side include

PS, your site looks good, so I added it to the mojo Sites page.

You're a Debian developer, thats very cool and definitely gives a few bonus points in terms of prioritizing your request

Cheers,

Joe
11/2/2005 10:55:42 PM
Gravatar
Total Posts 29

Re: Server side include

Hi Joe

Thanks for considering the request - I didn't want to jump the priority queue though ;-)

But nonetheless I consider to package mojoportal for Debian - it's a really nice piece of software and would certainly be of interest to Debian users. Are there any plans to support building with mono? I have tried the included Makefile with, let's say, limited success.

And just out of curiosity: Yesterday I looked a bit at the database tables, including the static html table. Is there a reason why all "special characters" are escaped in there or is that just done by the FCKEditor? I am still thinking about interfacing directly with the database and maybe dropping HTML content into it, but if it's not plain HTML but has to follow some rules, it will be more difficult.

PS: My site is still in progress - much content is still missing, and the layout will probably be improved too. I will also try to make it XHTML 1.0 compliant (which it isn't right now).

with best regards, Rene
11/3/2005 1:20:30 PM
Gravatar
Total Posts 18439

Re: Server side include

The makefile was added a long time ago by Joseph Hill but hasn't been maintained. Dean Brettle has added project files for MonoDevelop and he builds mojoPortal using MonoDevelop on a regular basis so that might be an option for you. There is a project called prjtomake (something like that not sure of the spelling) that converts vs.net 2003 projects to make files and that is what Joseph used before, you might look into that and be able to make a more up to date make file.

The Html is run through Server.HtmlEncode(string markup) to encode it before storage in the db and is then run through Server.HtmlDecode on the way out. This is recommended for security reasons. I will see if I can throw together a quick module to do what you want for including markup from an external file. I can do a copy/paste/modify probably of the Xml module so it really should be a short project, maybe this weekend I could have it in svn.

That would be great if you can make a package for Debian!

As for Xhtml compliance, the problem is that the 1.1 version of the .NET framework is not Xhtml compliant in its rendering of the built in server controls so no matter what you do it will not be compliant until we convert to the 2.0 framework. This is something I will be working on soon since 2.0 was just rtm along with VS 2005. It will also depend on how ready the 2.0 stuff is in mono. So the short story is sit tight on that and it will happen probably within the next few releases of mojoPortal pending testing on mono.
11/19/2005 8:32:16 AM
Gravatar
Total Posts 18439

Re: Server side include

I've just commited this new feature to svn if you are working with the svn code you can get it now. It expects the include files to live in the /Data/Sites/[SiteID]/htmlfragments folder. The edit screen lets you choose one of the files in this folder from a dropdown and it will include the contents of the file.

Once you've built and deployed the latest code you can add the feature either through the UI on the Admin-Feature Modules page or by using this sql (postgresql version)

INSERT INTO mp_moduledefinitions (featurename, controlsrc, sortorder, isadmin)

VALUES ('Html Fragment Include','Modules/HtmlFragmentInclude.ascx',500,false);

Let me know if this meets your needs or not.

Thanks,

Joe
11/20/2005 8:05:06 AM
Gravatar
Total Posts 29

Re: Server side include

Dear Joe,

Many thanks for implementing this server-side include that quickly. I'll try it out as soon as possible and let you know how it interacts with the tools I use (e.g. for converting a BibTeX publications list to a HTML page). Unfortunately, I am still struggling to make it compile with mono and the only Visual Study that I have currently available is VS.NET 2005, which doesn't work according to your news. Would it be possible to provide binaries of the current SVN version so that I can try them on my mono-based server while trying to make it compile properly there?

with best regards, Rene
11/20/2005 10:55:09 AM
Gravatar
Total Posts 18439

Re: Server side include

Hi Rene,

I've done a fresh build and zipped it up for you here

Be sure and back up your exisiting site and db as this hasn't been through a lot of testing.

Cheers,

Joe
5/30/2007 2:55:13 AM
Gravatar
Total Posts 18

Re: Server side include

Am I stupid or just unhappy?

I included this module on my page, but there is no drop-down list of files available for import. Of couse, I created some in corresponding directory. Do this files MUST have any particular extension?

 

Regards,

CarGa.

5/30/2007 7:33:05 AM
Gravatar
Total Posts 18439

Re: Server side include

Hi CarGa,

You found a bug. There is supposed to be an edit link (next to the gears icon) in the title of the module after you add it to the page. The link is actually there but there is no text assigned to the link so its not visible. I'm not sure what happened but somewhere along the way the text was lost. I have fixed this here and will have it in svn later today.

Thanks,

Joe

You must sign in to post in the forums. This thread is closed to new posts.