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 1 of 512345 > >>
AuthorMessages
John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4139
Avatar

--
13 Feb 2007 07:48 AM  

Have you ever wanted to get at more than just <%= SkinPath %>in your skin?

Maybe you want to display the name of the currently Active Page?

<%=PortalSettings.ActiveTab.TabName %>

Or maybe you want to display the name of the Active Page's Root level Parent?

<%=PortalSettings.ActiveTab.BreadCrumbs(0).TabName%>

If you want the currently Active Page's immediate Parent Tab Name try this:

<%=PortalSettings.ActiveTab.BreadCrumbs(PortalSettings.ActiveTab.Level - 1).TabName %>

 

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

--
20 Feb 2007 11:06 AM  

To get the ID of the tab/page you would use:

<%=PortalSettings.ActiveTab.TabID %>

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

--
20 Feb 2007 09:35 PM  

To print out if a User is logged in or not logged in you can use something like :

<%= iif(Request.IsAuthenticated,"LoggedIn","NotLoggedIn") %>

 

SamTanner
New Member
New Member
Send Private Message
Posts:3

--
16 Mar 2007 07:29 PM  
Hey John, what about the Title (not the name) of the currently active tab?
John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4139
Avatar

--
17 Mar 2007 08:56 AM  

Hi Sam,

That would be:
<%=PortalSettings.ActiveTab.Title %>

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

--
28 May 2007 07:31 AM  

Another feature that is not widely known is that you can create a link to a tab by just knowing the name of the tab/page:

<ahref="/?tabname=store">Store>
lynngrin
New Member
New Member
Send Private Message
Posts:96

--
29 May 2007 04:46 AM  
Hi John

What would you suggest for creating a hyperlink, within or surrounding the logo to return to the home page?

Lynn
John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4139
Avatar

--
29 May 2007 07:31 AM  
Hi Lynn,
For that I would just use the domain name without any page and let the system pull up the default page.
<ahref="http://www.drivewaydesign">LOGO>

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

--
29 May 2007 07:35 AM  
The editor keeps eating my closing anchor tag, but I'm sure you get the meaning.
John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4139
Avatar

--
29 May 2007 07:45 AM  

Another way would be like this:

<ahref="/?tabid=<%=PortalSettings.HomeTabId%>">LOGO
But that would only be if you had the Home tab set in site settings.
John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4139
Avatar

--
13 Jun 2007 11:31 AM  

How to show the name of the Portal.

<%= PortalSettings.PortalName %>

SamTanner
New Member
New Member
Send Private Message
Posts:3

--
29 Jun 2007 09:11 PM  
Hey John,
On the last item in the first post, the currently Active Page's immediate Parent Tab Name: Would you mind extending this a little to take care of the case when the tab happens to be at root level?  In other words, if this code is on a root-level page, DNN gives an 'out of range' exception.  Could you test first for the root-level case and if true, display the current tab's TabName. Else use the script above.

Thanks for all your help and advice!
John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4139
Avatar

--
30 Jun 2007 09:56 AM  

Hi Sam.

That's a good point. It would break a lot that way wouldn't it?

<% 
    If PortalSettings.ActiveTab.Level > 0 Then
        Response.Write(PortalSettings.ActiveTab.BreadCrumbs(PortalSettings.ActiveTab.Level - 1).TabName)
    End If
%>
John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4139
Avatar

--
11 Jul 2007 12:19 AM  

To get the current portal's home directory (i.e. /portals/0 ) you would use:

<%= PortalSettings.HomeDirectory %>

jncraig
New Member
New Member
Send Private Message
Posts:88

--
20 Jul 2007 10:38 AM  

Beware that if there is a page also named "store" in the recycle bin that this will fail.  Otherwise, it's a GREAT solution.

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

--
20 Jul 2007 11:03 AM  

Hi Joe,

Which one fails if there is a tab named "store" in the recycle bin?

Jeff Parker
New Member
New Member
Send Private Message
Posts:1

--
22 Jul 2007 02:38 AM  
Posted By John Mitchell on 07/20/2007 11:03 AM

Hi Joe,

Which one fails if there is a tab named "store" in the recycle bin?

John, I think he means this one: <ahref="/?tabname=store">Store>, which I am also struggling with.

My DNN is installed in a folder and when I try the above it assumes the domain root. What code can I use to make it construct the url correctly?

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

--
22 Jul 2007 08:40 AM  
The tabname parameter will onl work if there is only one tab with that name. Maybe there is one in the recycle bin and one that has not been deleted, or maybe there is one with the same name under a different parent.

If this is the case and you can't make it unique then you will have to use the tabid instead.
<atarget=_blankhref="<%=NavigateUrl(36)%>">Home</a>
jncraig
New Member
New Member
Send Private Message
Posts:88

--
22 Jul 2007 01:27 PM  
Yes, I was referring to the tabname= format. Thanks for the other pointers, too!
akleinwaechter
New Member
New Member
Send Private Message
Posts:2

--
24 Jul 2007 12:17 PM  
Hi there,

this is a cool thread! I'm wondering if there is a portalsettings method like:
<%= PortalSettings.getTabIDbyTabName("store") %>
in order to get a tabid for the startingpoint of the solpartmenu, e.g. if you have two menus on a skin. Then you could save the portal as a template and don't have to correct the tabid for the menus everytime you make a new portal.
is there an easy solution for that in the skin? Or do I have to change the skins.vb?

Thanks
Alex
Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Page 1 of 512345 > >>


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