This is a post in my blog series Introduction to Chameleon...
While writing this introduction series, I've received quite a few questions and, as promised, I'm posting the answers on today's post. Note that some common questions have been combined.
- I've been working on a CS2.1 theme. Should I wait for CS2007/Chameleon to complete it? Will CS2.1 themes be supported in CS2007?
Whether you should wait for CS2007 is up to you. Hopefully these introductory posts have helped provide some insight into the simplification of themes in CS2007 and the benefits of the new theming engine. As others have hinted, there should be a beta version available soon and we're hoping to get feedback on the changes that have been made. I suggest that you try out the beta(s) and provide feedback. I feel that Chameleon is easy to "dive into" and hopefully after reading these introductory posts, it's even easier.
That said, we're hoping to respond and adjust according to beta-testers feedback. Or, in other words, the release won't be for a while. If you want to release a site soon, you probably won't be able to wait for CS2007.
CS2007 does support CS2.1 themes -- but its currently a one-or-the-other switch. You cannot mix Chameleon-based themes and CS2.1-based themes. If you're interested in the other features of CS2007 (Morpheus, Tallyman, or other enhancements), you will be able to install your custom CS2.1-based theme on CS2007 and then upgrade your custom theme to Chameleon as you see fit.
- I really want to try CS2007/Chameleon. When will the beta be released?
As has been hinted on communityserver.org and Jose's blog, the first beta should be released soon. We're hoping to get a lot of feedback from it. I'd suggest keeping an eye on the Announcements forum on communityserver.org to see when the first beta will be released (I'll probably mention it on this blog too
).
- Will CS 2007 be XHTML 1.1 Strict compliant? Or, if not XHTML 1.1 Strict, some level of compliance?
CS2007 ships as XHTML 1.0 Transitional compliant (similar to this blog). It should be possible to implement XHTML 1.0 Strict and XHTML 1.1 and I would expect that future site/blog themes would meet these levels of compliance.
One of the many benefits of the Chameleon theming engine is that there is almost no hard-coded markup. Theme developers have almost complete control over the final rendering of their pages. I'm excited to see what theme developers will be able to do when they start working with Chameleon.
- Has accessibility for blind and visually impaired users been improved in Chameleon?
In the front-UI (outside of the control panel), there is no need to use pop-up menus or other JavaScript-rich (screen reader confusing) UI elements. Chameleon supports rendering mark-up from the very simple to the very complex.
While the default site theme that will be included in CS2007 may not be 100% accessible, the areas of more limited accessibility can easily be enhanced using Chameleon.
- How does implicit data-binding work? Is this easy to tie into as a control developer?
Implicit databinding makes use of the IDataItemContainer interface and the CSControlUtility class--when retrieving the current object for a control's context, Chameleon traverses the control tree "up" from the "current" control to find a parent control implementing IDataItemContainer with a DataItem of a specified type. To retrieve a specific type of object, the CSControlUtility class exposes a method:
public virtual T CSControlUtility.GetCurrentBoundObject<T>(Control currentControl) where T : class
which can be used to load any data type from the current control's context as in:
User currentUser = CSControlUtility.Instance().GetCurrentBoundObject<User>(this);
which will load the currently binding User object relative to "this" control. CSControlUtility also exposes CS-object-specific methods which implement additional logic such as the CSControlUtility.GetCurrentUser() method which will retrieve the current user from the current Post, Section, Rating, as well as any currently-bound User.
The methods of the CSControlUtility class and its application-specific overrides are publicly accessible and ready to be used by external controls. Additionally, the CSControlUtility class can be extended for custom CS-based applications. Each Chameleon control (those inheriting from the base Chameleon control classes) is ensured to be databound and only needs to load its own datasource (if not otherwise programmatically specified) using the methods described above.
- How can I execute custom code within a Chameleon control?
Most Chameleon control's ITemplate properties (LeaderTemplate, ContentTemplate, FooterTemplate, etc..) support ASP.net inline databinding syntax, for example, to show the current blog post's URL (as rendered text), you could use
<CSBlog:WeblogPostData runat="server">
<ContentTemplate>
<%# BlogUrls.Instance().Post(WeblogControlUtility.Instance().GetCurrentWeblogPost(this)) %>
</ContentTemplate>
</CSBlog:WeblogPostData>
Note that you do not need to add a null check for the result of GetCurrentWeblogPost(this) because the <CSBlog:WeblogPostData /> control will only databind and render if there is a currently-bound WeblogPost object.
- Does CS2007/Chameleon use ASP.net master pages?
The default theme of CS2007/Chameleon does use ASP.net master pages, however, the theme developer has complete control over how master pages (or the type of master pages) are used.
- Is there a way for each user to define more than just CSS Overrides when customizing a theme through the Control Panel?
Definitely! Rob has already posted a few teaser screenshots of our "dynamic theme" support. I hope to blog more about this feature and its flexibility soon. The dynamic theme support is still in development, so it may be a little while yet before I start a blog series describing it.
What I can say is that it is very easy to use and integrates completely with Chameleon.
Please continue to ask questions regarding Chameleon via my contact form or by leaving a comment. I'll continue adding questions/responses/notes on this blog.