Custom Pages Redux

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.
1/29/2012 8:27:17 PM
Gravatar
Total Posts 40

Custom Pages Redux

I've been plowing through the forums and developer docs as a means to accomplish something for a project I'm working on and found this post about adding "custom pages" from back in 2008. I also found the page starter templates in the 4.x CodeSmith templates. But I couldn't find anything in the Developer docs that covered the actual process of adding in these custom pages. I'm in a bit of a time crunch so I'm looking for a little guidance on how best to proceed.

When you add custom pages to a site in mojo, do you also use a web application project, or do you just copy the .aspx and .aspx.cs pages to a folder in the root of the mojoportal.web project? Do you still want to set the AutoEventWireup to false? What about linking to the custom pages from pages in the mojoportal site or from the custom pages to pages within the site?? Any other advice you can offer?

1/30/2012 12:39:53 PM
Gravatar
Total Posts 1204
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Custom Pages Redux

I'd recommend you look at some of the numerous aspx pages that are delivered with mojoPortal. There are a lot of them under /Admin. So you'll place the aspx page wherever you want it linked (the web root is one option, which would give you a link of www.mysite.com/mypage.aspx). Your mypage.aspx.cs code will get compiled into a DLL if you're using the code behind method (as the delivered mojoPortal code does). That DLL goes into the /bin folder. So basically it's very similar to developing a custom mojoPortal module, except that you are creating a real standalone page instead of a feature that can be placed on any page within the context of the mojoPortal site's virtual structure.

Don't rely on the wrapper that Joe provided in that old forum post. Most likely it has changed, and the Codesmith templates or an existing aspx page will be the best way to model your new page.

Jamie

1/30/2012 1:08:24 PM
Gravatar
Total Posts 40

Re: Custom Pages Redux

Yeah I noticed the CodeSmith templates in the 4.x folder were different than that blog post. I started using the 4.x template, and as I am super new to mojoportal, I wanted to make sure I was using all the best practices stuff that is built into this. You know, the old "ounce of prevention / pound of cure"

1/30/2012 1:18:02 PM
Gravatar
Total Posts 18439

Re: Custom Pages Redux

If you are doing development of custom features for mojoPortal I recommend as Jamie said to study existing code in mojoPortal. To be able to do that you need to actually be working with the mojoPortal source code in Visual Studio. Often people open up the pre-compiled deployment file packages in VS and think they are working with the source code but they are not. Those packages are already compiled and don't have any C# source code.

See also Understanding the Difference Betwen Deployment Files and Source Code.

1/30/2012 1:24:00 PM
Gravatar
Total Posts 40

Re: Custom Pages Redux

I'm definitely working with the source code, and I'm looking forward to working with the project as a whole more.  I can see the advantages of extending it through modules, but for me it's all about making sure I'm doing it right the first time.

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