Custom page on folder based multisite

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
6/3/2011 5:24:41 PM
Gravatar
Total Posts 137
When enough isn't

Custom page on folder based multisite

Hi,

Am I wrong on something or can't I create a custom page (domain/foldername/custompage.aspx) which you can call from within the menustructure of the folderbased site?

I can create a custom page which works on the maindomain (domain/custompage.aspx), but I can't put the same page on a lower level at the folderbased site. Or maybe I'm doing something wrong?

I have created a folder with both a fysical default and custom page in (domain/foldername/default.aspx and domain/foldername/custompage.aspx).

Best regards

Lars
www.boostadventure.dk
www.nysport.dk
 

6/5/2011 1:14:04 PM
Gravatar
Total Posts 18439

Re: Custom page on folder based multisite

Supporting pages in features in mojoPortal do not work that way, we don't make different copies of physical pages for folder sites. As long as the url for the page has the foldername for the site in the beginning of the url, the url re-writer will re-write the url to the one on the root folder but it will resolve the siteid based on the folder name.

But when you say it is in the menu that is not the recommended way to develop re-useable features for mojoPortal. ie I don't recommend just make stand alone pages and link them into the menu. None of the existing features has supporting pages linked in the main menu. The entry point of a feature is the usercontrol loaded on the CMS page and in the usercontrol we build the links to supporting pages. When it is a folder site the folder is part of the url to the supporting page and it works fine even though the file doesn't really exist at the location beneath the site folder.

Hope that helps,

Joe

6/5/2011 3:35:57 PM
Gravatar
Total Posts 137
When enough isn't

Re: Custom page on folder based multisite

Hi,

I think I understand what you're saying and recommending. The situation is though such, that I have already created a usercontrol on a regular mojoportal page (on my folderbased site), from where I link to a custom page. The usercontrol shows a list of events where I can show details for each event on the same custom page depending on query id's. I have to use a custom page here to avoid mojoportals canonical url - else they all will be google indexed as the same page. I'm using the page to show a lot of different event-content dynamically.

I know I can shot off the canonical url generally and then theoretically just solve the detail showing with a usercontrol. But then I can't activate canonical url manually where it's needed, eg. on root pages. See my question in another forum post.

Anyway I still can't call my custom page from my custom usercontrol with the link like: ~/sitefolder/custompage.aspx?queryparameters

Any idea what I can do about it?

Best regards
Lars

6/6/2011 4:41:18 AM
Gravatar
Total Posts 137
When enough isn't

Re: Custom page on folder based multisite

Sorry for the alarm. Now I got it working.

The key is that you should place a custom page in the root folder - not in the site folder. When I do that MojoPortal picks up the custom page from root even though it seems to get it from the folder. So it's important both to place the custom page in the root and to point on the page in pagesettings as if it's in the root (~/custompage.aspx and not ~/customfolder/custompage.aspx). That works.

Thanks for good help always and a wonderful Mojoportal system. If anyone need more detail on this topic please write here for my learnings.

Best regards
Lars

6/6/2011 7:02:08 AM
Gravatar
Total Posts 18439

Re: Custom page on folder based multisite

Hi Lars,

In building the links in your module control I would not hard code the site folder in the path like:

~/customfolder/custompage.aspx

where customfolder is the site folder. That would break it in the root site if you code it that way.

If your module inherits from SiteModuleControl there is a built in property for SiteRoot that will include the folder name as needed, so you build your link like

SiteRoot + "/custompage.aspx" (I would also pass in the pageid and module id as query string parameters).

If your module control is just a plain usercontrol then you can do:

string SiteRoot = SiteUtils.GetNavigationSiteRoot();

then use it to build your url the same as above.

You could find examples of how links are built by studying the code of other mojoPortal features. Really for any troubles you may have in custom feature development, you can find something similar in existing features to get ideas how to do things.

Hope that helps,

Joe

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