Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHow can I get current URL without the page name?How can I get current URL without the page name?
Previous
 
Next
New Post
11/20/2012 12:18 PM
 

Hi All,

I'm trying to build a side menu of links for a portal and would like to avoid hard coding the full URL for each link.  Is there a way to get the current URL without the page name? 

For example, let's assume this is the URL for my intranet:

http://intranet

Regardless of where I am on the intranet, I'd like my first link to point to Page1.aspx.  This would work fine if I am always in the root of the site but sometimes I may be a few levels deep and that wouldn't allow the link to work like this:

href=Page1.aspx

How can I get the URL of the current portal without the page name?

Thanks,

Mark

 
New Post
11/20/2012 1:23 PM
 

like this: base link (<a href="/">base link</a>)


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
11/26/2012 2:08 PM
 
Hi Sebastion,

Sorry, I don't follow.

Let's say I have the following pages:

home.aspx
parent.aspx
---- Child1.aspx
---- Child2.aspx

I'd like make a module with links that would always point to home.aspx and parent.aspx regardless of the level within the portal but I don't want to hard code the full path.

Is that possible?

Thanks,
Mark
 
New Post
11/26/2012 5:53 PM
 

If you are building the module yourself then this is possible -  however I would suggest that instead of a module - you should be looking a creating a skin object.  Using a skin object will let you add the menu to EVERY page on your site by placing the object on your SKIN as opposed to manually adding a module to your pages,

A good place to start maybe would be looking at the code from Leftmenu skin object - /admin/skins/LeftMenu.ascx.cs.

It show a detailed example of how to create a left side menu - and how to loop thru the TabController to dynamically build your list of pages on the fly.  In fact, it would be reasonable easy to just copy this skin object and add the code to include the HOME Page and PARENT Page at the top of the menu when its drawn.

Westa


 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHow can I get current URL without the page name?How can I get current URL without the page name?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out