SELECT * FROM tabs
where parentid=@TABID
Wednesday, March 25, 2009
DotNetNuke - Copy skin of tab to multiple pages using T-SQL
UPDATE Tabs
SET
SkinSrc = (SELECT SKINSRC FROM Tabs WHERE TabId=@TABID_TO_COPY_FROM)
WHERE TABID = @DTABID_TO_UPDATE
From DotNetNuke Forums.
Monday, March 23, 2009
Getting the code you want from DotNetNuke
Introduction:
DotNetNuke development is always an interesting for me. New developers come to the forums posting same silly questions again and again, and guys out there on the forums give them a gentle reply with some guidelines. This happens always everyday on DotNetNuke Forums. Sometimes i think is it really hard to find what we want from DotNetNuke source and DotNetNuke web app?
Understanding the way DotNetNuke works:
I think developers should start learning DotNetNuke from the basic understanding about portals, tabs, modules, skins, skin objects etc. Don't start your development before understanding these terms. I am not going to introduce or summarize these terms as you will find many web logs regarding this.
Getting started with development:
Once you get basic understanding about this, you will be able to understand how DotNetNuke development will go for you. Once you are done with this, whenever you need to write a code that you don't have ask this questions to your self: Is DotNetNuke doing this? How DotNetNuke is doing this? For instance, if you are looking for code to dynamically create a tab in dotnenuke. you should ask, is DotNetNuke creating dynamic tabs? and the answer is obviously yes. Second question is how it is creating the tab? This is a hard question for new developer. Basically, all the DotNetNuke admin related stuff can be found in admin directory. If you look at ~/Admin/Tabs/ManageTabs.ascx, You will see the page that is used to create a new tab from DotNetNuke UI. Click on update link and you can easily find the code written in vb. You just need to find a part of code you basically want. You can also convert this code to c#.
How to search the code i want?
Well its really depends upon what code you want. But if you think like the way I demonstrated above, you will probably find the code you want after some trial and errors. The big help will be from the DotNetNuke UI and the way the directory structure is provided. Let's take another example of updating a user. So for finding that code, if you look at admin folder, you will find ~/Admin/Users where we think the code can be. Let's try that folder first. Opps! looking at the folder increases the problems, we have many controls in it unlike tabs folder. So let's try the controls one by one. Just open the ascx control on by one in design mode and see if you can find update button on it. Well the control ~/Users/User.ascx controls a floppy icon which is obviously a universal icon for save in DotNetNuke . so let's see what is written in the code of the click event of it. Well it contains a code to create a new user as well as update an existing user. Am I right? Ok, so this code says UserController.UpdateUser() is a method you can use to update the user. Just pass userportalid and userinfo object to it, and it will update the stuff. So if you want to implement a custom user profile update page, you just need to get the userInfo object from UserController.GetUserByName and assign the new values to the object properties and UserUser Method of the UserController class. An you are done.
Conclusion:
So basically DotNetNuke has all the code you want. You just need to guests where can i find the code and just go through the code and you will definately find the code you want. Accessing source code is more complecated than accessing web application because you don't have UIs to compare with, but once you got familiar with DotNetNuke , you will find your required code in the source code also. I think DotNetNuke documentation is also helpful finding the right code as well as if you understand the way DataProvider and SqlDataProvider implemented, it will be fun digging into the code.
Best luck with your DotNetNuke code review and hope you will find the code you need from DotNetNuke .
Friday, March 20, 2009
Free DotNetNuke skin template of BluePrint CSS framework
- The template is of so basic lavel
- There is a single container
- Single skin file with html4 strict doctype validation.
- No skin objects or dotnetnuke controls are added in it
- Very light weight and simple template
You can download the skin template from here. The template will help you implementing your skin quickly.
You can find an example skin BluePrint0.1 implemented here.
- The example skin implementation is a very basic level and same as the default dnn blue skin
- Tried implementing the sking with just a grid.css and only core basic classes so that everyone can understand the dnn classes as well as blue print css classes easily
- IE and Mozilla fonts are leaved intentionally different so that users can understand they can fix ie related css stuff in ie.css
- No images, single basic container.
- YSlow : 28.4k Stylesheet files(4 files), 0.05k image (BluePrint.png), 169.2k Javascript files, total 214.4k with 17 requests.
Thursday, March 5, 2009
Free DotNetNuke Skin - Nutica
My third free dotnetnuke skin converted from a free xhtml template. Here is a quick description:
- Different layout support - supports one column, two column, three columns
- Different containers - 4 containers, each for left, right and middle column and a middle column block quote container
- Single package for skin and container, its working in dotnetnuke 4.5.5, but if its not working for you, extrack the file, and you will get different zips for skin and container, paste them to different folder and rename them with Nutica.zip
- Again, the limitation with this is, menu and submenu are not formated properly and not looking too good. please tell me how can we improve this?
- Download the skin
Please give your valueable feedbacks about the skin, so that i can improve the stuff. Providing feedback will help me understanding the skins conversion, that will help me write my tutorial about converting xhtml template to a dotnetnuke skin.
Note: Free skins are in this blog are distributed under creative common licence, you can use all skins for free, but please provide credit link to my blog. Thanks
Wednesday, March 4, 2009
Adding javascript events to dropdownlist items
XHTML Code
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="1">Item 1</asp:ListItem>
<asp:ListItem Value="2">Item 2</asp:ListItem>
</asp:DropDownList>
C# code
foreach (ListItem item in DropDownList1.Items)
{
item.Attributes.Add("onclick", "itemclick(this);");
}
Javascript code:
function itemclick(obj)
{
alert(obj.text);
alert(obj.value);
}
DNN 5 - Get All tabs
TabController controller = new TabController();
TabCollection tabs = controller.GetTabsByPortal(0);
IDictionaryEnumerator hs = tabs.GetEnumerator();
while (hs.MoveNext())
{
TabInfo tab = (TabInfo)hs.Entry.Value;
Response.Write(tab.TabName + "<br/>");
}
Popular Posts
-
Get Started Let's create an html table that is showing some sample data. Here is it: <table> <tbody> ...
-
Hi all, Creating a modal popup for asp.net users is always easy, its simply a modal panel, modal popup extender of asp.net ajax and all is ...
-
// using DotNetNuke.Entities.Portals; // using System.Collections; PortalAliasController paController = new PortalAliasController(); PortalA...