John Mitchell Posts:3040


| | 07/24/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 Posts:2

| | 07/27/2007 9: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 Posts:16

| | 08/20/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 Posts:3040


| | 08/23/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 Posts:16

| | 09/02/2007 1:07 AM |
| and thank you very much for that!  Rob | | | |
|
u101440 Posts:2

| | 10/03/2007 7: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 Posts:3040


| | 10/03/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 Posts:2

| | 10/04/2007 3: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 Posts:3040


| | 10/04/2007 7: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 Posts:19

| | 11/14/2007 9: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 Posts:3040


| | 11/14/2007 10:31 AM |
| Hi Lee, Try this: src="<%=PortalSettings.ActiveTab.IconFile%>" | | | |
|
dnncreative Posts:19

| | 11/15/2007 2: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 Posts:3040


| | 11/15/2007 8: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 Posts:19

| | 11/15/2007 8:58 AM |
| Thanks John | | | |
|
tlyczko Posts:29

| | 12/07/2007 9: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 Posts:29

| | 12/07/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 Posts:3040


| |
tlyczko Posts:29

| | 12/07/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 Posts:29

| | 12/07/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 Posts:29

| | 12/07/2007 1: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 | | | |
|