Welcome Guest Search | Active Topics | Log In | Register

How to change module appearance? Options
joeuser
#1 Posted : Monday, June 08, 2009 1:41:43 PM
Rank: Newbie

Groups: Users

Joined: 12/1/2008
Posts: 8
I want to change the look and feel of an existing module. The problem is that the module is not using the templating mechanism, as it does not include the repeating elements: it really simple and contains only a few textboxes and a button. However, I need several versions of the UI for this module, while the backend functionality will remain the same.
Any ideas?
khorvat
#2 Posted : Monday, June 08, 2009 3:10:33 PM
Rank: Member

Groups: Administrator , Administrators, Publishers

Joined: 2/3/2009
Posts: 11
Hi,

there are several ways to change look and feel of the module.

1. You can implement custom css selector class and change appearance of the module with css classes (Maybe the easiest way)
2. You can use the "Two markup files on code behind" technique.

2.1 Tell your class that it is templated, in Constructor (IsTemplated = true;)
2.2 Create a folder for your module in "App_Templates/YourThemeName/ModuleName" and set "ControlSpecificTemplateSubPath" property of the module to "ModuleName"
2.3 Create a UserControl inside that folder, and use ActionBox template as an example

<%@ Control
Language="C#"
AutoEventWireup="true"
Inherits="MonoSoftware.MonoX.ActionBox.MonoXActionBoxControl"
%>

<table class="ActionBox" cellpadding="0" cellspacing="0">
<tr>
<td class="Header">
<%--Options Start--%>
<%--Note: This ID is hard-coded--%>
<asp:Panel ID="PlaceHolderOptions" runat="server" ></asp:Panel>
<%--Options End--%>
</td>
</tr>
<tr>
<td class="Content">
<%--Content Start--%>
<%--Note: This ID is hard-coded--%>
<asp:Panel ID="MainPlaceHolder" runat="server" >
<asp:Panel ID="PlaceHolderContent" runat="server" ></asp:Panel>
<asp:Panel ID="PlaceHolderEdit" runat="server" ></asp:Panel>
</asp:Panel>
<%--Content End--%>
</td>
</tr>
<tr>
<td class="Footer">
<%-- Footer Options Start--%>
<%--Note: This ID is hard-coded--%>
<asp:Panel ID="PlaceHolderFooter" runat="server" ></asp:Panel>
<%-- Footer Options End--%>
</td>
</tr>
</table>

2.4 Put as many as you want UserControls with all sorts of layouts inside the markup
2.5 Now you can load your templated layout with combination of „TemplateFullVirtualPath“ and „Template“ properties of BasePart
2.6 Now you need to put all of your controls dynamically to panels / content place holders

......................................................................
Kristijan Horvat

Mono Ltd.
tel: + 385 (0)31 213 966
fax: + 385 (0)31 213 967
http://www.mono-software.com
......................................................................

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.