Directory Reference

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
2/21/2008 8:38:32 PM
Gravatar
Total Posts 43
Partner

Directory Reference

Our company hosts quite a few websites built on top of the mojoPortal. The thing we struggle with the most is referencing images and content that belongs to that site. Our most recent approach is to create an “assets” folder under /data/sites/xx/ so it looks like /data/sites/xx/assets/. For a few sites I then create a website called http://assets.domainname.com/ that points to the assets folder and lets users references things much easier. I even created a script that loops through all the images and pdfs to show the client how to reference the objects.

Now on to my question…

I doubt this is possible, but it is at least worth asking, would it be possible to configure the mojoPortal to intercept a request like http://www.domainname.com/assets/smile.gif and actually have it pulled from http://www.domainname.com/data/sites/xx/assets/smile.gif ?

If not, has anybody else had a hard time referencing things in CSS and overall layout and have a better solution? I am aware it is possible to reference things like ../../.

Thanks,
-Todd Lewis
 

2/22/2008 6:31:42 AM
Gravatar
Total Posts 18439

Re: Directory Reference

Hi Todd,

Its possible to do the kind of url mapping you describe for images but only if you have ownership of the server and can install an ISAPI filter to do the re-writing. This blog post mentions a couple popular ones. The reason you can't just do it in .NET code is that .NET is not the handler for image files, they are served directly by IIS without ever giving .NET code the chance to intervene. So currently we can do url-rewriting in .NET but we can only do it for extensions handled by .NET like .aspx. On Linux its very easy to make .NET the handler for all requests within a given directory so the situation is different there.

I'm not sure, there may be other techniques by which you can make .NET handle web requests for images (on Windows) but I think any of them will require that you have control of the server and won't work in typical hosted environments. But if you can make .NET the handler for images then you could do the re-writing in .NET code.

As for using images in css like for setting background images, the location of the image is always relative to the css file itself so if you put the images in the same folder as the css file then you can just enter the image name like 'imagefile.gif', if you put images in a subfolder of the skin folder named images, you can reference in the css using just 'images/imagefile.gif'

Hope it helps,

Joe

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