Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:13

Creation of a sitemap


Poster: gerarcyr
Dated: Tuesday February 21 2006 - 13:36:46 GMT

Hi,

is there any function which allows me to create a site map from my menu ?
I would like to create a sitemap page on my intranet, with all the items of my menu.

Thanks in advance.


Poster: John
Dated: Tuesday February 21 2006 - 13:52:07 GMT

Try this.


Poster: gerarcyr
Dated: Tuesday February 21 2006 - 13:56:29 GMT

John wrote:
Try this.

Thank's a lot, this is exactly what i'm looking for....

Sitemap


Poster: annasue
Dated: Wednesday June 14 2006 - 16:30:23 BST

I tried the link at "Try this" and am getting an error on the page. I even tried just pasting the code in without altering it at all and it still doesn't work.

http://www.webs2impress.com/infotec/secondpage.html

Thanks for your help.


Poster: John
Dated: Wednesday June 14 2006 - 16:35:07 BST

The "this" link, which is http://support.milonic.com/demos/site_index/index.htm, is working fine. Just tried it numerous times.

Sorry, don't know what to tell you.


Poster: annasue
Dated: Wednesday June 14 2006 - 16:39:21 BST

The link works fine. It's the code that page supplies that isn't working.


Poster: John
Dated: Wednesday June 14 2006 - 16:51:54 BST

Sorry, feel like I'm pulling teeth here. Exactly what is it about the code that is not working?


Poster: annasue
Dated: Wednesday June 14 2006 - 17:05:51 BST

Well, it isn't displaying a sitemap when I click on sitemap. The instructions said to place this code where I wanted the sitemap to be called:

<SCRIPT language=Javascript src="http://www.webs2impress.com/infotec/menus/mm_siteIndex.js" type=text/javascript></SCRIPT>


This isn't putting anything in that spot.

This is what I have in the embedded_main_menu.js file.

aI("image=images/buttonbkgrnd.jpg;url=javascript:http://www.webs2impress.com/infotec/menus/mm_siteIndex('windowAttributes')");

Also, when you click on SiteMap on the menu bar, there is an error displayed at the text field at the bottom of the window.

I am endeavoring to use the demo version for the moment because the company will not allow me to put the building files under their domain until it has been approved by all. I fully intend to get the license then. Could this be the problem? The horizontal menus are working without problems.


Poster: John
Dated: Wednesday June 14 2006 - 17:37:30 BST

Did you take the sitemap code from the demo page...
Code:
var mm_tName;

function mm_listMenu(mN)
{
  var j, iN;

  _iwd.write("<ul>");

  for (j=0; j<_m[mN][0].length; j++)
  {
    iN = _m[mN][0][j];

    _iwd.write("<li>");

    if (_mi[iN][2] != null) _iwd.write('<a href="' + _mi[iN][2] + '" target="' + mm_tName  + '">');
    _iwd.write(_mi[iN][1]);
    if (_mi[iN][2] != null) _iwd.write('</a>');

    if (_mi[iN][3] != null) mm_listMenu(getMenuByName(_mi[iN][3]));

    _iwd.write("</li>");
  }

  _iwd.write("</ul>");
}

function mm_siteIndex(windowAttributes, indexHeading) // , cssFile)
{
  var attr = "toolbar=no,scrollbars=yes,resizable=yes,status=yes";
  if (windowAttributes.length > 0) attr += "," + windowAttributes;
  _iWin = window.open("", "Site_Index", attr);

  _iwd = _iWin.document;

  if (_iWin.window.opener.name.length == 0) {
    _iWin.window.opener.name = "parentwin";
  }
  mm_tName = _iWin.window.opener.name;

  _iwd.open();
  _iwd.write("<html><head><title>Site Index</title>");

  if (arguments.length > 2) _iwd.write('<link rel="stylesheet" type="text/css" href="' + arguments[2] + '">');

  _iwd.write("</head>");
  _iwd.write("<body>");
  _iwd.write("<h1>" + indexHeading + '</h1>');
//  _iwd.write('<h1><div style=""><input type="button" value="< Back" onclick="window.opener.history.back()"><input type="button" value="Next >" onclick="window.opener.history.forward()"></div>' + indexHeading + '</h1>');
//  _iwd.write('<p class="toolbar"><input type="button" value="< Back" onclick="window.opener.history.back()"><input type="button" value="Next >" onclick="window.opener.history.forward()">');

  for (i=0; i<_m.length; i++)
  {
    if (_m[i][7])
    {
      mm_listMenu(i);
    }
  }

  _iwd.write("</body></html>");

  _iwd.close();
}

...save it to a file called mm_siteIndex.js, and upload it to your server in the appropriate spot as ASCII (straight text)?

Using the demo version of the software to get going should cause no problems at all.


Poster: annasue
Dated: Wednesday June 14 2006 - 19:45:57 BST

I had already copied this file to the directory and put it on the server. However, just in case there was a problem, I copied what you sent to the correct filename and moved that to the server. Now I am not getting the error message but neither is the sitemap working either.


Poster: Ruth
Dated: Wednesday June 14 2006 - 21:33:39 BST

Hello,

I used your posted url for the mm_siteIndex.js file and get a file not found. Without that file there's no site index.

Ruth


Poster: annasue
Dated: Wednesday June 14 2006 - 21:50:11 BST

It is a sub directory "menus".


Poster: Ruth
Dated: Wednesday June 14 2006 - 22:33:46 BST

Hi,

I have no idea what's up. I just put your page and your files up at my site and everything is working fine. I changed your www to mine of course but as you can see when you get there, it has the same folder layout as you are using.


So, you can try this and see that it works. I'm using your unlicensed files instead of mine so I kept everything the same.

Ruth


Poster: Ruth
Dated: Wednesday June 14 2006 - 22:41:10 BST

Hi,

Just found the problem, but I don't know why it's a problem.

Change your url for the aI string that has the siteIndex to

Code:
aI("image=images/gtsitemap01.jpg;overimage=images/gtsitemap02.jpg;url=javascript:mm_siteIndex('windowAttributes','indexHeading');");


It is probably because that siteIndex.js file is in with the milonic files. I'm not good on paths. I'd think that a full path would work but it doesn't seem to do that, however the one above works.


You should also be aware that this will NOT give you item names when you're using images. It just says undefined. The links work but all your main menu items show in the site map as undefined.

Ruth
Ruth


Poster: annasue
Dated: Wednesday June 14 2006 - 22:46:45 BST

Thanks so much! That fixed it! Is there no way around the "undefined" thing?


Poster: John
Dated: Wednesday June 14 2006 - 23:38:54 BST

Not sure about this, but try a title=;


Poster: annasue
Dated: Wednesday June 14 2006 - 23:46:04 BST

Well, I had that in there once and on my horizontal menus, it put the text over my graphics and that's not what I want....sigh...


Poster: Ruth
Dated: Thursday June 15 2006 - 3:57:57 BST

Hi,

No, there's no way around the undefined when you have images unless the mm_siteIndex.js file is modified. I think there's a alt property for images, or maybe that's for title and possibly that could be done, adding a if the code for text is not present then look for the title or something else might be used, say status but that's the only way it can be done as far as I know.

By the by, this is not a Milonic 'module'. It was created by a user.


Hope that made sense :?

Ruth


Poster: annasue
Dated: Thursday June 15 2006 - 12:15:14 BST

Yes, it made sense, Ruth. Thank you for all your help.

Re: Creation of a sitemap


Poster: iain_s
Dated: Wednesday July 29 2009 - 17:54:49 BST

Problem using mm_siteIndex.js


I'm trying to create a siteindex for 'www.doxeyca.co.uk' and have implemented the code into the index page for the site.
All I get is a window with the heading 'Doxey Site Index II' (see html below).
It seems that in the code

Code:
for (i=0; i<_m.length; i++)
  {
    if (_m[i][7])
    {
      mm_listMenu(i);
    }
  }


_m_length must be zero as there is no '<ul> </ul> in the html.

The only (slightly) non-standard things on the site are
- the menu file is called 'dm_menu_data.js' (not 'menu_data.js')
- There are 4 menus in use which are called individually (ie no 'Main Menu' although I have specified it to see if it cured the problem.



Menu Call line (in 'Doxey and the Net')

Code:
aI("text=Generate Site Index;
url=javascript:mm_siteIndex('top=50,left=50,height=500,width=600,toolbar=yes,
menubar=yes','Doxey Site Index II','doxey.css');");


html generated for SiteIndex :

Code:
<html><head><title>Site Index</title><link rel="stylesheet" type="text/css" href="doxey.css"></head><body><h1>Doxey Site Index II</h1></body></html>


I'm not very experienced with js so I may be missing something
Iain

Re: Creation of a sitemap


Poster: Ruth
Dated: Wednesday July 29 2009 - 19:02:50 BST

Hi,

I think it is because you are using pop menus and there is no visible main menu. I can't test in IE on my desktop because it gives me an 'access denied' code. However, I did try it in FF3, Safari 4, Google Chrome, Opera 9 and it worked fine in all of them. What I did was create a style I called invisibleStyle, then set that main menu to alwaysvisible=1, removed all text from it and only left the showmenu parts. Try this in your data file and see if it works.

Add the invisible style

Code:
with(invisibleStyle=new mm_style()){
onbgcolor="";
oncolor="";
offbgcolor="";
offcolor="";
menubgcolor="";
pagebgcolor="";
subimage="";
}


Then make the main menu the following, you'll see I removed any of the words after text and I also removed the title, not knowing what would happen with that in it.

Code:
with(milonic=new menuname("Main Menu")){
style=invisibleStyle;
top=1;
left=1;
alwaysvisible=1;
aI("text=;showmenu=Doxey Today;");
aI("text=;showmenu=Doxey and the World;");
aI("text=;showmenu=Community Association;");
aI("text=;showmenu=Doxey and the Net;");
}


I tried to see if I could mouseover that invisible menu up at the top left 1px setting and get the submenus to show, but I could never find it so that shouldn't be an issue. The submenus will still popup from the pop up calls you have on the page, and when you click site index you now get one with all the links in it :)

Hope this helps, let me know if there are any other problems and I will try to work on it, but I am not a js person either and this wasn't created by Milonic but by a user so there is no way to 'fix' things since I have no clue how to change anything :(

Ruth

Re: Creation of a sitemap


Poster: iain_s
Dated: Wednesday July 29 2009 - 19:25:10 BST

Thanks Ruth - worked like a dream.