Web Services
 Nuke Master Posts:322

 |
| 12/28/2011 9:05 AM |
|
I am using the solpart menu on this site: gipt.intellicomweb.com. On the home page, I have the DDR menu attached to the solpart and it has a little bit of a fancier effect on the drop down. On the internal pages, I just have the plain solpart and there are no effects. The problem I'm running into is in the Clinics dropdown.... "Children's Rehab" is linked to an external site so I have this in the redirect of that page's settings so that it'll open in a new window - "javascript:window.open ('www.site.com', 'newWin')". It works fine on the internal pages but on the home page, the gipt site redirects to a blank page that says [objectWindow]. Is there anyway I can get the page to open in a new window correctly (like on the internal pages) but have the fancier effects of the dropdown (like on the home page)?? It doesn't matter if I fix the DDR version or add to the plain solpart version. I don't have a preference as to what menu to use. Or if there's a different DNN integrated menu that would work, that would be fine too. Any suggestions? Thanks! |
|
|
|
|
Joseph Craig DNN MVP Posts:11667

 |
| 12/29/2011 7:23 AM |
|
It isn't clear that the problem is with the menu. But, I would recommend that you replace the SolPart menu with the DDR menu in your skin. If you look at the instructions for DDR, it's really easy to do the replacement. Once you do that, your menu items become much easier to work with. I have used DDR menu in a situation similar to what you described. Since the menu generates links, I was able to add a little bit of jQuery to add a target="_blank" attribute to the link that I wanted to open in a new window. |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
Web Services
 Nuke Master Posts:322

 |
| 12/29/2011 4:58 PM |
|
I have the DDR menu on the home page.... and it's only when I change the menu from Solpart to DDR that the opening in a new window doesn't work correctly. Could you give me a sample of the kind of jQuery that I could add? That would be great if there was a simple fix so that I could still use the DDR menu. Thanks! |
|
|
|
|
Joseph Craig DNN MVP Posts:11667

 |
| 01/04/2012 11:38 AM |
|
If you can select the link that you want to change, you might be able to do something like
jQuery('#topMenuCommon270 > a').attr("target", "_blank");
With DDR Menu, you also have the opportunity to create a custom template -- the easiest approach is to make a copy of an existing template and rename it -- and just add the target="_blank" attribute to the links that you need to open in a new window. |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
Web Services
 Nuke Master Posts:322

 |
| 03/05/2012 10:25 AM |
|
What if I can't select the link? There's no specific id or class given to each menu item. Here's an example of a menu item.... td nowrap="nowrap" class="MainMenu_MenuItem" unselectable="on" style="position: relative;" a style="position: absolute; display: block; border: 0pt none; padding: 0pt; margin: 0pt; top: 86px; left: 0px; bottom: 0pt; right: 0pt; text-decoration: none; background: none repeat scroll 0% 0% transparent; width: 351px; height: 38px;" href="javascript:window.open (' http://www.childrensrehabcenter.com/', 'newWin')" span style="visibility: hidden;">Children’s Rehab Center /a Children’s Rehab Center /td I tried changing the "unselectable" to off but that didn't make any difference. How can I go about adding an id to each menu item? Thanks! |
|
|
|
|
Joseph Craig DNN MVP Posts:11667

 |
| 03/06/2012 7:38 AM |
|
Can you remind me which version of the DDR menu you are using? And which template? |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
Web Services
 Nuke Master Posts:322

 |
| 03/06/2012 8:48 AM |
|
DDR Menu 2.0.1 DNN 06.01.01 template - I've just changed the solpart menu to point to the DDR files. I haven't added any specific menu template to it because it was functioning like we wanted it to without adding any further template or styling. |
|
|
|
|
Joseph Craig DNN MVP Posts:11667

 |
| 03/06/2012 11:48 AM |
|
Can you point me to a URL where I can see it? |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
Web Services
 Nuke Master Posts:322

 |
| 03/06/2012 1:31 PM |
|
gipt.intellicomweb.com |
|
|
|
|
Joseph Craig DNN MVP Posts:11667

 |
| 03/06/2012 1:41 PM |
|
If you look at the page source, you will notice that each link is associated with an li element and each li has a unique nid attribute. While I haven't tried it, it seems like it would be quite straightforward to use jQuery to target a specific nid and change the anchor tag that is its child. Is that enough to get you started? |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
Joseph Craig DNN MVP Posts:11667

 |
| 03/06/2012 1:46 PM |
|
Hmmm ... I'm not sure that I'm answering the question you asked. Can you ask it again, and differently? |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
Joseph Craig DNN MVP Posts:11667

 |
| 03/06/2012 1:51 PM |
|
Aha! It's the window.open that's causing the problem. So, remove the window.open, replace the url with a link to the page (without window.open) and use jQuery to add the target="_blank" attribute to the link as I described. |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
Web Services
 Nuke Master Posts:322

 |
| 03/07/2012 9:38 AM |
|
Okay thanks! I was just inspecting the menu using Firefox but viewing the page source gave me some different code. So I know the nid's of the elements that need to open in a new window but now I'm not sure how to call the jQuery. I thought it would be as simple as adding the code below to the head of my skin but it's not working. And do I just call the nid like so (#90) or do I need to preface it with the div it's in like so (#menu90)? <script type="text/javascript"> <br /> jQuery((#90 > a)).attr("target", "_blank"); <br /> </script> |
|
|
|
|
Web Services
 Nuke Master Posts:322

 |
| 03/07/2012 9:39 AM |
|
note... the line break tags above aren't in my code. For some reason they were added after I hit submit. |
|
|
|
|
Joseph Craig DNN MVP Posts:11667

 |
| 03/07/2012 12:04 PM |
|
That's close, but not quite right. First, using the # will target an "id" and not an "nid." To do that you will need to use a selector in this form: jQuery('[attribute|="value"]') So, jQuery('li[nid|"999"]') should target an li with nid=999. If you need to read further: http://api.jquery.com/attribute-con...-selector/ |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
Joseph Craig DNN MVP Posts:11667

 |
| 03/07/2012 3:04 PM |
|
And this isn't quite going to work. I wasn't paying attention to the title of this thread and didn't realize that you were using the Solpart variant of the DDRMenu. The one seems to lose the nids in converting the rendered ul/li structure into a table structure (that's what the jQuery does). I think that if you can switch to the DNNNav variant that the nids get converted to a class (I believe that because Mark Allan told me it is so!) and you can then select and style them normally. After jQuery gets done, the actual runtime html is changed. If you know how to use Chrome's tools, you can right-click on a link to see exactly which classes are applied and do your modifications to that Ask in you need help as this gets in a few layers... |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|
Joseph Craig DNN MVP Posts:11667

 |
| 03/07/2012 3:11 PM |
|
I should also have mentioned that there is a form of the jQuery selector that lets you select the html string or a part of the string in the element. |
|
Joe Craig, Patapsco Research Group Complete DNN Support |
|
|