What happens if i clone and modify Modules/HtmlModule.ascx?

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.
4/15/2010 10:11:13 AM
Gravatar
Total Posts 251

What happens if i clone and modify Modules/HtmlModule.ascx?

I wanted to add an extra title to the html modules, but not to all of them, so i planned to copy the functionality of "show title" option in the options.

But i was not successful, so i decided to go the easy way, just copy Modules/HtmlModule.ascx to Modules/MyModule.ascx and change something inside.

I am wondering... mixing the "real" module and the "new" html modules will cause problems in the database? Or the different GUIDs will distinguish them from each other?

4/15/2010 3:09:48 PM
Gravatar
Total Posts 18439

Re: What happens if i clone and modify Modules/HtmlModule.ascx?

If you really clone it correctly you will have your own table and not use mp_HtmlContent so there will not be any clashes, you will use a different namespace different named stored procedures, different resource file, you will share nothing in common with the original feature.

Hope it helps,

Joe

4/15/2010 4:30:13 PM
Gravatar
Total Posts 251

Re: What happens if i clone and modify Modules/HtmlModule.ascx?

in the beginning i was thinking to do that, by converting the page to inline code (i am too lazy to wait hours to recompile/upload mojoPortal.Web.dll for every minimal change)

Then i thought that there could be some naming conflicts about variables, and problems when update the database, so i just thought to leave CodeBehind="HtmlModule.ascx.cs" , i was thinking that the module guid will avoid clashes

But since this behaviour is not supported or tested, i think i will follow your instructions (sorry, i am a c# noob, never studied anything about computer programming - my major is biology cheeky)

so, for doing a proper independent clone, i have to change the namespace mojoPortal.Web.ContentUI to anything i like, but to change the db table it seems it's a very hard task

it looks like i have to change a lot of stuff, the referiments to mojoPortal.business/htmlcontent.cs and how it interfaces to mojoPortal.Data.MySql/dbHtmlContents.cs

that means that for making an easy mod to some html contents i basically have to make a fork of mojoportal that would be impossible to maintain in the future with my skills (i am so noob that I can't even get the code from SVN)

i am right or there is an easier way?

4/15/2010 4:33:43 PM
Gravatar
Total Posts 131

Re: What happens if i clone and modify Modules/HtmlModule.ascx?

Just a real world example. I "cloned" the way you originally proposed without any issue. I shared the same DB, bus layer and it worked fine. Just changed the aspx and aspx.cs (and designer) pages.

There is the right way (Joe's way) and the fast way.

One thing I would caution. If you can clone it in another project. Keep the namespace of the UI layer the same and copy it over upon build of the new project. That way, you stay away from issues when upgrading mojo - especially if you want to do a clean upgrade which is helpful sometimes.

4/15/2010 4:41:26 PM
Gravatar
Total Posts 18439

Re: What happens if i clone and modify Modules/HtmlModule.ascx?

Hi,

Your clone should go into its own project(s), this way you are only forking a copy of the feature not forking mojoPortal. The whole idea of cloning is to avoid forking mojoPortal. You can easily script off the mp_Html table and related procs and then change the table prefix from mp_ to something else in the script, then run the script to create your custom table and procs.

Cloning a feature is a developer task, I've never claimed it was something that just anyone can do, but for experienced developers it is not that difficult.

I'm not sure what you mean by adding an extra title, seems like you could put that right into the html content using the wysiwyg

Hope it helps,

Joe

4/16/2010 5:18:52 AM
Gravatar
Total Posts 251

Re: What happens if i clone and modify Modules/HtmlModule.ascx?

i just wanted to tweak the css styles of the html box for some modules

anyway, i found your http://www.mojoportal.com/cloning-an-existing-feature.aspx very useful, i did not see it before, i will try to understand it

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