Menu Icons and more WebParts work

If you've visited this site before you've probably noticed the new menu icons. Just added that over the weekend into branches/2.1. It was low hanging fruit. There was already a field in the mp_Pages table for MenuImage that had been there a long time but not implemented as a feature. So I added the UI elements to pick an icon and hooked it into the menu.

The only interesting bits about the implementation was that while the ASP.NET Menu items have an image property, the standard SiteMapNode does not so there was no where to store it when populating the node tree from within a custom SiteMapProvider. Not a difficult problem at all though, I just implemented a mojoSiteMapNode that inherits from SiteMapNode and add a property to store the image url. Then when I build the node tree I populate it with mojoSiteMapNode objects.
Since I'm already handling the MenuItemDataBound event to filter the menu based on roles I just had to add a little code ther to populate the image like this:

mojoSiteMapNode mapNode = (mojoSiteMapNode)e.Item.DataItem;
if (mapNode.MenuImage.Length > 0)
{
      e.Item.ImageUrl = mapNode.MenuImage;
}

Pretty sweet!

The other cool thing that landed in svn branches/2.1 this weekend was my further WebPart work including the WebPartModule and WebPartAdminModule features mentioned in my previous post, allowing use of 3rd party WebParts (if you can find some) both in the MyPage feature and anywhere in the content system. Also I have implemented the feature on MyPage to allow users to create as many "pages" of personailzed content as they like similar to pageflakes.com.

Now I still have some work to do in styling the User Page Menu on MyPage in the various skins (so far I've only been working in subblue). I'm not the greatest designer as I'm sure you have observed but hopefuly it will come out looking something like tabs.

With this, almost all of the compelling new 2.0 ASP.NET features are being used to good advantage in mojoPortal which means we are getting close to a time when I can try and focus on identifying what needs work in mono to get mojoportal 2.x working. There is still just one more big 2.0 feature I would like to take advantage of and that is the new improved localization features. I shied away from the conventional 1.1 .NET localization in the current mojoPortal localization implementation because I felt it had one fatal flaw. It required storing resource strings in satellite assemblies which meant a developer would need to be involved just to change a label. I felt very strongly that it should be possible to change any label with a text editor and not require any compilation. This and more is now possible and efficient in 2.0 .NET and would give us some ability to adapt labels in the site to the culture of the user's browser (if we have resources for his culture) with fallback to a default culture if not available. I still think the value added is very limited because the bulk of the content comes from the db and will never localize unless a person translates it but it is worth doing because there is some benefit if the login button and other buttons are localized as well as calendar and date time formats, it may help someone who knows some english for example but is not fluent.

I think I am leaning toward making the 2.1 release before tackling the localization changes. It will not be difficult but it will be a lot of grunt work copying strings from the culture files into the resource editor and going through the site to make the changes.

So I guess its a little more polish on the MyPage stuff, some QA and then make the 2.1 release

For those of you following along with the sources from svn, I pretty much work in branches/2.1 most of the time except when making changes that require db schema changes. To avoid breaking things for users who are working from svn I do the db change work in my sandbox branch and only merge it back into 2.1 once I have all the data layers implemented. This weekend I merged quite a bit, you may need to look for the newer stuff in the upgrade scripts if you are working with an existing db. There is still quite a bit of things to do before the release but I think the db changes are done for this coming release.

Comments

re: Menu Icons and more WebParts work

Tuesday, June 20, 2006 11:39:46 AM
Where did you get the menu icons?
Joe

re: Menu Icons and more WebParts work

Tuesday, June 20, 2006 2:49:58 PM
from other open source projects
Comments are closed on this post.