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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0append a urlparameter to all tabs in the menu from the moduleappend a urlparameter to all tabs in the menu from the module
Previous
 
Next
New Post
9/23/2009 12:58 PM
 

hello all,

I made a module (that appears below the menu, if it matters or not) and I need to append some parameters to all the tabs of the menu.

I searched for tabcontrolcollection but I couldn't find many results although i think i need something (C#) in the sense of

pseudocode:
foreach tab in portal.getalltabs(activetabid)
{ tab.url+="?x=2";}

any ideas?

 

 
New Post
9/23/2009 9:03 PM
 

While your post is a bit cryptic, I think I can answer your question.  You can't automatically append something to the url of all tabs from inside another module.

DNN menu systems build up the Urls for all the tabs in a menu internally in their module code.  Each of the Urls is obtained by the menu module via a call to the DotNetNuke.Common.Globals.NavigateUrl({..]) call.  This runs the Url through the designated Friendly Url Provider and returns the formatted Url.  This is all done in 'real time'.  The Urls for DNN tabs are never stored in the database, and are always dynamically generated.  This is to allow for changes in the Url format, language identifiers, that sort of thing.

If you want your module to affect all of the Urls for all of the tabs in the install, well, you're plain out of luck.  Even if you did write your own Menu provider which added a querystring to the end of the Url for each tab, there are plenty of other ways of getting a Url on a DNN page without going through the menu : for example, the breadcrumb links and other modules which generate tab based urls.

If you want to have a system-wide setting caused by your module, I would look into using a session variable, or a persistent portal setting, or even a cookie.

 
New Post
9/25/2009 7:42 PM
 

Hello Bruce,

Pending figuring this out, I used a cookie but this is not the correct solution as a new visitor to the site will have the data appended in the URL while a regular user (after first visit, the cookie sets in), his display will be generated from the cookie's content.

the querystring I want to append is calculated from the module which is loaded AFTER the tabs are generated.

I don't want my module to affect all the urls of all the tabs in the install and I know that links are not stored in the db, they are generated by multiple calls to the db (a weakness in dnn compared to other portal systems, like Genetica), but nevertheless, assuming my own menu provider appends the URL, if that URL content is generated after the menu has outputted, then there is a problem that can only be solved either by delaying the response or by a javascript append.

this seems the best approach pending other ideas

Looking at the __dnnvariable in view source , what do you think can be done to append X=1 to these guys?assuming X =1 comes from the server, from the module which executed following the menu and added a response at the end of the page

something along <s cript ...javas cript ..> a .innerhtml.replac("!!", "?X=1");? </s cript>

this is a sample of the viewsource, in particular the _dnnvariable input part

&lt;n id=666 key=666 txt=Cars ca=3 url=/dotnetnuke/Automotive/Cars/tabid/666/Default.aspx>&lt;n id=727 key=727 txt=Cars A-E ca=3 url=/dotnetnuke/Automotive/Cars/CarsAE/tabid/727/Default.aspx>&lt;n id=734 key=734 txt=Deawoo ca=3 url=/dotnetnuke/Automotive/Cars/CarsAE/Deawoo/tabid/734/Default.aspx />&lt;n id=733 key=733 txt=BMW ca=3 url=/dotnetnuke/Automotive/Cars/CarsAE/BMW/tabid/733/Default.aspx />&lt;n id=767 key=767 txt=Buick ca=3

 

................

 

Updated:

I checked the menu across DNN 4.8 and DNN 5.1 and it seems the sequence in the _dnnvariable changes with dNN versions... very disappointing because this means a javascript fix will work on a version today and may not work on a new menu tomorrow

So,

I am looking for a core fix (either menu provider, breadcrumbs providers, ...) modification or a change to the stored procedure that gets the tabid to pass a placeholder that I can later (when the module loads) modify on client side.

 

What do you think now? cryptic or not cryptic?

 
New Post
9/28/2009 7:56 PM
 

> they are generated by multiple calls to the db (a weakness in dnn compared to other portal systems, like Genetica)

This is actually not true.  A properly setup DNN site will not call the db to generate the urls for the menu.  The information should be coming from cached objects.

I don't agree with a javascript solution, nor a modification to the portal source code.  As I posted before, I would suggest you look at the problem from another angle and try and solve your objective in another way.    If you change the core code, or mess around with the core page variables, you will come to grief at some point in the future when you need to upgrade the core but cannot due to a compatibiltiy problem.  You should never modify the core DNN code unless you are fixing a bug which will be fixed in a future release.

 
New Post
10/1/2009 11:42 PM
 

I don't like the javascript solution either, this is why i think i can solve this by cookies.

is there a way to retrieve all the tabids of the menu without rebuilding a query to the db and inner joining permissions and visibilities and taborder...?

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0append a urlparameter to all tabs in the menu from the moduleappend a urlparameter to all tabs in the menu from the module


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