Creating Friendly URL for one Module for Another

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.
6/10/2009 8:43:49 AM
Gravatar
Total Posts 131

Creating Friendly URL for one Module for Another

Hopefully I can clearly articulate this one.

I have a custom module that is built on the same principle as the webstore.  It's a catalog of events, and multiple catalogs can be created if the module is added to different pages, just like you could have multiple stores.

My issue is this.  On a landing page, I'd like to be able to add a form that allows a user to create a catalog item.  This module would be independent of the catalog module, but would add an item to a specific catalog.  When users add an item, I would like to create a friendly url to the catalog item description page, which lives within the catalog module.

Is there a way to determine the page / module id's of a specific catalog instance  (other than referencing by name) so I can add that to my friendly url creation in the other module?

6/10/2009 9:19:17 AM
Gravatar
Total Posts 131

Re: Creating Friendly URL for one Module for Another

I think I have figured a pretty easy way to do this without requiring any customization to the base mojo code.

I have added a setting the the feature installation called moduleInstanceKey.  In this I give it a unique name.

I wrote a quick function that then joins the module settings table and module page tables.  By providing the unique name, I can get the page and module ID for that instance.  At least I think so, I am implementing now.  If it works well, I'll post how I implemented it.

 

6/11/2009 5:56:43 AM
Gravatar
Total Posts 18439

Re: Creating Friendly URL for one Module for Another

Hi David,

There is no constraint on module instances that they have unique names so it should not be relied on as a way to lookup a specific one.

I generally avoid any cross talk or dependencies across modules myself, but if I were trying to do a lookup of instances of a specific feature from another feature, I would create a module setting using a .ascx that implements ISettingControl, if it were to lookup WebStore instances then I would call it WebStoreStoreListSetting.ascx

Then internally I would use the known feature guid and the site id to populate a dropdown of store instances in the site. Again there is nothing preventing one from making 2 stores in a site with the same name (though I don't recommend it), so I might mange the module id into the label for each item in the list like moduleid - storename or storename - moduleid

I guess since you need the page id too you would mange the moduleid and page id into the value of the listitem maybe separated by ~ so the setting you would store is moduleid~pageid and you would parse them by spliting on the ~, you might also mange the page name in with the WebStore module name for the display text of the listitem.

Hope it helps,

Joe

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