Posts in Category: Features

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.

A Good Example of a Site Using WebParts

If you follow my blog posts you probably know I am working on converting the built in mojoPortal features into WebParts. Actually I'm working on the Personalization and Membership APIs first which is the foundation for getting the most out of WebParts.

Probably not everyone really knows what kind of cool things you can do with WebParts. I just learned about http://www.pageflakes.com/ from someone's forum post at www.asp.net

pageflakes.com uses the ASP.NET WebPart framework. notice how you can drag things around and arrange the page and add or remove content. You don't even have to login to try it. Mouse over any of the module titles on their site and your cursor changes to the drag cursor. Click the Edit link to add or remove content.

In the not too distant future it will be possible to do things like this in mojoPortal. My plan is to make it configurable so that you can have pages the user cannot modify but you can also have pages they can customize

I think that is way cool. What do you think?

This Page Is Valid XHTML 1.1!

I did a little more tweaking and now This Page Is Valid XHTML 1.1!

Again you have to try it with the source from a browser like Firefox, if you just point the validator at this page it renders down level which is not compliant.



I should note that the FCKeditor is only XHTML 1.0 compliant so any page with an editor will not validate against XHTML 1.1 until that support is in place. In any case since browsers seem to be forgiving I think I can still go forward with the XHTML 1.1 DOCTYPE

Also I had to fix even more content in the db where I have historically had the bad habit of using target=_blank on links to external sites. target is no longer valid in XHTML 1.1

This site is also currently using much more CSS layout and most of the table layout has been removed. I'm still working on a few areas of this and still need to update more of the built in skins to work with the new model but I figured it was good to go ahead and do the skin for this site first so I can test it in the real world.

Thanks go out to Alexander Orlov for help and good advice in working toward XHTML compliance.

This Page Is Valid XHTML 1.0 Transitional!

After a good bit of work, according to the Wc3 validator page, this page is Valid XHTML 1.0 Transitional!

Now if you want to confirm this yourself I will say you can't just enter the url www.mojoportal.com and have it come up valid becuase when the validator pages makes a request it is rendered differently than when using a browser. In other words the .NET Server controls do their down level rendering when it can't detect the browser and apparently the downlevel rendering is not valid.

If you view this page with Firefox and then right click and view the page source then save this file as www.mojoportal.htm and upload it to the validator it gives it the nice approval.

Ultimately I would like to get to Strict compliance instead of Transitional but this is a step in the right direction.

Another factor that comes into play in a CMS like mojoPortal is whether the existing markup in the database that has been entered using the CMS features conforms. I think in general FCKeditor does produce valid markup, but I have found places where I edited stuff directly as source and I didn't do it with XHTML validation in mind at the time so I am cleaning things up in the content as well as in mojoportal code. For example using a valign attribute on a td is not valid for Transitional and moving forward toward Strict, links with a target attribute are not allowed so I am cleaning up things like that too.

I doubt if all the pages in this site are currently valid but I am making progress and eventually we will be able to proudly display the icon

Will mojoPortal run on a Nokia 770?

Jospeh Hill recently added Sqlite support to mojoPortal mainly to make it easier to fit on the mono-live cd.

But Sqlite can also be embedded in a device and there seems to be a movement afoot to try and get mojoPortal running on the Nokia 770. The Nokia 770 is not a phone, I would be tempted to call it a PDA, but the branding used by Nokia calls it an Internet Tablet. Whatever you call it, it looks pretty cool to me!


I'll be following that story with interest!