John Mitchell Posts:3033


| | 02/13/2007 7: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 Posts:3033


| | 02/20/2007 11:06 AM |
| To get the ID of the tab/page you would use: <%=PortalSettings.ActiveTab.TabID %> | | | |
|
John Mitchell Posts:3033


| | 02/20/2007 9: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 Posts:3

| | 03/16/2007 7:29 PM |
| | Hey John, what about the Title (not the name) of the currently active tab? | | | |
|
John Mitchell Posts:3033


| | 03/17/2007 8:56 AM |
| Hi Sam, That would be: <%=PortalSettings.ActiveTab.Title %>
| | | |
|
John Mitchell Posts:3033


| | 05/28/2007 7: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 Posts:91

| | 05/29/2007 4:46 AM |
| Hi John
What would you suggest for creating a hyperlink, within or surrounding the logo to return to the home page?
Lynn | | www.drivewaydesign.eu For A Dream Driveway
www.a2zdom.com Domain name matters
| |
|
John Mitchell Posts:3033


| | 05/29/2007 7: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 Posts:3033


| | 05/29/2007 7:35 AM |
| | The editor keeps eating my closing anchor tag, but I'm sure you get the meaning. | | | |
|
John Mitchell Posts:3033


| | 05/29/2007 7: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 Posts:3033


| | 06/13/2007 11:31 AM |
| How to show the name of the Portal. <%= PortalSettings.PortalName %> | | | |
|
SamTanner Posts:3

| | 06/29/2007 9: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 Posts:3033


| | 06/30/2007 9: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 Posts:3033


| | 07/11/2007 12:19 AM |
| To get the current portal's home directory (i.e. /portals/0 ) you would use: <%= PortalSettings.HomeDirectory %> | | | |
|
jncraig Posts:79

| | 07/20/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 Posts:3033


| | 07/20/2007 11:03 AM |
| Hi Joe, Which one fails if there is a tab named "store" in the recycle bin? | | | |
|
Jeff Parker Posts:1

| | 07/22/2007 2: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 Posts:3033


| | 07/22/2007 8: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 Posts:79

| | 07/22/2007 1:27 PM |
| | Yes, I was referring to the tabname= format. Thanks for the other pointers, too! | | | |
|
akleinwaechter Posts:2

| | 07/24/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 | | | |
|