Sign In  |  Register
 
 
DotNetNuke Support Forums
DotNetNuke Tokens: Some tricks for getting more than SkinPath in your skin.
Last Post 03 Jun 2009 09:01 AM by mgroves. 88 Replies.
Printer Friendly
Sort:
PrevPrevNextNext
Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Page 2 of 5 << < 12345 > >>
AuthorMessages
John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4138
Avatar

--
24 Jul 2007 11:16 PM  

Hi Alex,
That one is a little harder.  It sounded very familiar though, so I did a google search and came up with a thread I had responded to here:
http://www.snapsis.com/DotNetNuke/Support/tabid/560/forumid/11/tpage/1/view/topic/postid/6193/Default.aspx#6206

That one looks like it didn't really get answered though, so here's what I think you want:

<scriptrunat="server">
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

       Dim oTabController As New TabController
       dnnMENU.StartTabId = oTabController.GetTabByName("Store", Null.NullInteger).TabId

    End Sub
</script>

If you have some other Id for your menu then use that instead of dnnMenu, and if you have more than one you can just put another line like this:

<scriptrunat="server">
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

       Dim oTabController As New TabController
       mySolpartMenu1.StartTabId = oTabController.GetTabByName("Store", PortalSettings.PortalId).TabId
       mySolpartMenu2.StartTabId = oTabController.GetTabByName("Other", PortalSettings.PortalId).TabId

    End Sub
</script>
akleinwaechter
New Member
New Member
Send Private Message
Posts:2

--
27 Jul 2007 09:45 AM  

Hey ,

that's a great solution and works lika a charm for me. And the best: no development environment setup needed!

thnaks thanks thanks

Alex

 

robax
New Member
New Member
Send Private Message
Posts:16

--
20 Aug 2007 12:47 AM  
Hi john,
Is there a bit of code that will pull up the domain of the current portal?
I'm trying to add a link in a skin that is used on multiple portals. It is to load "http://mail.domain.com" and thus it always points to the domain's webmail server.

I want to make up a link something like this (a href="mail.")webmail(/a)
Is that a possiblity?

Thanks for any info on this
Rob
John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4138
Avatar

--
23 Aug 2007 12:48 PM  

Hi Rob,

This is how you get the current Alias for the portal:

 

<%= CType(HttpContext.Current.Items("PortalSettings"),PortalSettings).PortalAlias.HTTPAlias %>
robax
New Member
New Member
Send Private Message
Posts:16

--
02 Sep 2007 01:07 AM  

and thank you very much for that!

Rob

u101440
New Member
New Member
Send Private Message
Posts:2

--
03 Oct 2007 07:50 AM  
I'm having some problems with my skin and specifically the solpartmenu. I have a nice rounded edge as part of a style to the left of my menu that I'd like to change based upon the page I'm on. The image is a background style applied to a table column that the solpartmenu resides in.

You can see my site here: http://www.psybt-trial.co.uk

Now I've though that I'd need to apply a piece of VB to determine the URL (to see if it has the word home or nothing specified as it could be a sub page or the first page of the site) and I've used something like this to test my theory:

Public Function sShow() As String
If InStr("home", "home") > 0 Then
Return "MenuTD"
Else
Return "MenuTDBlack"
End If
End Function

Within my skin I have the variable <%=sShow %> as the style for the td but my skin fails to load and I end up seeing the master style.

I believe the problem may lie in how I'm referencing the VB as I'm not sure what file I should be placing it within to make it work properly. I've tried adding it tothe codebehind files that appear to be referened at the top of my skin but this hasn't worked.

I'm also thinking about using the setting from earlier in this thread - PortalSettings.ActiveTab.BreadCrumbs(0).TabName - to determine the breadcrumb but wasn;t sure if this was the best method to use. Any advice appreciated.
John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4138
Avatar

--
03 Oct 2007 10:15 PM  
You need the script runat="Server" part to put code like that in your skin.

I think you would be better off trying out one of the other methods in this thread though.
u101440
New Member
New Member
Send Private Message
Posts:2

--
04 Oct 2007 03:06 AM  
Thanx John

I simply added this to the standard.ascx file:

Dim sShow

if lcase(PortalSettings.ActiveTab.BreadCrumbs(0).TabName) = "home" then
sShow = "MenuTDBlack"
else
sShow = "MenuTD"
end if

and within the td class I added the sShow variable and all seems well now. However, is this well formed or should the code be elsewhere and indeed should it be runat="Server" as well?
John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4138
Avatar

--
04 Oct 2007 07:52 AM  
If you just want to give that TD a different class selector when you are on the home tab you could do it directly in the TD like this:

<tdclass='<%= IIF(PortalSettings.ActiveTab.TabName = "Home", "MenuTDBlack", "MenuTD") %>'>


I don't think you want to use the first tab in the breadcrumb because that will always be Home.
You could also give each tab their own selector by just adding the name of the active tab to the class selector and making it a combo selector:
<br><br><tdclass='Menu <%= Replace(PortalSettings.ActiveTab.TabName," ","") %>'><br><br>


The above code will produce class='Menu Home' when you are on the Home Tab, or class="Menu ContactUs" when you are on a tab named Contact Us.


dnncreative
New Member
New Member
Send Private Message
Posts:19

--
14 Nov 2007 09:01 AM  

Hello,

Ok, here's one.

I want to take the icon that you can select in the page settings and display that image directly in the skin rather than the menu. - The image that I will be selecting will be large and it will be for a banner image for the page. - I'm trying this method as it will allow the client to easily select a new banner image for each page.

I've been experimenting with changing the bannerimage section into a content pane, but when you log in it sends the layout all over the place, so the best solution is to select the image to display on the page settings.

So, is it possible to display the page icon from the page settings within a skin page?

Thanks for any tips, cheers,

Lee

John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4138
Avatar

--
14 Nov 2007 10:31 AM  

Hi Lee,

Try this:

src="<%=PortalSettings.ActiveTab.IconFile%>"

dnncreative
New Member
New Member
Send Private Message
Posts:19

--
15 Nov 2007 02:30 AM  

Hi John,

Great, thanks, nearly there. - This gives me the name of the image file, but what I also need is the exact location of the file so the client can upload these images to any location within their portal.

How are you finding out this info, is there a certain area in the source code where you can track each of these elements?

Thanks,

Lee

John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4138
Avatar

--
15 Nov 2007 08:44 AM  

If they upload a file then it will probably be in their Home Directory ( portals/0, portals/1, etc.).

PortalSettings.HomeDirectory is how you get that folder.

I get the stuff in this thread mostly from just having done something simular in the past, but you can use the object browser in Visual Studio to browse the PortalSettings object and find out everything it offers.

dnncreative
New Member
New Member
Send Private Message
Posts:19

--
15 Nov 2007 08:58 AM  

Thanks John

tlyczko
New Member
New Member
Send Private Message
Posts:30

--
07 Dec 2007 09:37 AM  
Are there any similar techniques I can use to customize how the Search box looks??
e.g. color the input box, the button, use a small image instead of a giant button...
tlyczko
New Member
New Member
Send Private Message
Posts:30

--
07 Dec 2007 12:10 PM  

Is there a way to show only Login or UserName and not show "Register" at all in the User token??

Thank you, Tom

John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4138
Avatar

--
07 Dec 2007 12:31 PM  

Hi Tom,

For the Search Box, you can change it's look using normal CSS.
Look towards the end of this thread for some ideas on styling the Search Box.
DNN 4.5.2 Web and Site Search radio buttons 

Check out this post for the User SkinObject modifications.
Changing the User SkinObject to Display UserName instead of FirstName LastName in DotNetNuke

tlyczko
New Member
New Member
Send Private Message
Posts:30

--
07 Dec 2007 12:48 PM  
Hello John,
What I want is the opposite effect of what you did with the Register -- I don't care about the user name display -- I just don't want to show the "Register" part at all.
I found the proper ids for styling the Search box, thank you!!
I also found search.ascx and figured out how to change that...
Thank you, Tom
tlyczko
New Member
New Member
Send Private Message
Posts:30

--
07 Dec 2007 12:51 PM  
I found the id for dnn_dnnUSER_cmdRegister and set it to hidden in the skin.css -- but I only want the word 'Register' not shown, not the user name.
HTH Tom
tlyczko
New Member
New Member
Send Private Message
Posts:30

--
07 Dec 2007 01:01 PM  
I figured it out partway from an earlier post in this thread, this pseudocode is what one needs in the ascx file instead of the standard call to the USER token:

<%=IIf(Request.IsAuthenticated, "Show the user name", "")%>

How would I code showing the username within this IIf statement??

Thanks, Tom
Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Page 2 of 5 << < 12345 > >>


Active Forums 4.1
Visit our Store for great DotNetNuke Modules and Skins
DotNetNuke CSS Menu 3.4.1 (single use)

Item codeCSSNM33SU
AuthorJohn Mitchell
Base Price$39.00
Product Information 
DotNetNuke CSS NavMenu 3.4.1 (Developers)

Item codeCSSNM33DEV
Base Price$149.00
Product Information 
DotNetNuke Performance Caching & Compression - PageBlaster 3.4.5 - Professional Edition

AuthorJohn Mitchell
Base Price$59.00
Product Information