menudata js to noscript menu converter flaw dataminer.php

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Dijkman
Beginner
Beginner
Posts: 7
Joined: Mon Sep 10, 2007 6:03 pm

menudata js to noscript menu converter flaw dataminer.php

Post by Dijkman »

Hello

does someone maybe know if there is a converter php script
menu_data.js to a html link page for the noscript users/browsers

or am i talking nonsense
and is there another way to convert all links in the menudata.js
to a html page
for non javascript browsers and searchengines

greetings luberth
http://www.snipperdag.com
Last edited by Dijkman on Sat Sep 22, 2007 5:21 pm, edited 1 time in total.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Not that I'm aware of.

However, you could make your menu list-based, which will allow it to be read not only by non-JS users (or those who have it turned off), but also the search engines.

It's not quite the high-class spit and polish yet that Andy likes, but it does work without problems. See http://milonic.com/listbased/.
John
Dijkman
Beginner
Beginner
Posts: 7
Joined: Mon Sep 10, 2007 6:03 pm

Re: menudata js to noscript menu converter

Post by Dijkman »

Yes ok

but maybe someone made an php script to convert
a menu data.js file
to a list based page

i think more people would find such a util handy to greate a list based page from the data.js


or is it possible to get a list based menupage from a menudata.js file
so that i can save it for the noscript part and for searchengines friendly page

but may give probles because i have a frame based menu with two data files for side menu and body frame menu

http://www.snipperdag.com
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Re: menudata js to noscript menu converter

Post by Andy »

php_sitemap will allow you to create sitemaps and UL based menus etc.

it's in the /extras/ directory in the menu download under php_sitemap

-- Andy
Dijkman
Beginner
Beginner
Posts: 7
Joined: Mon Sep 10, 2007 6:03 pm

Re: menudata js to noscript menu converter

Post by Dijkman »

Hello

Thanks much
this is was exactly what i have been searching for
spend hours on it
But didnt find it
So thanks for your helping answer

greetings luberth

example of the output from dataminer.php
a plain text tab based milonic menu

http://www.gravomaster.com/om/menu.php
Dijkman
Beginner
Beginner
Posts: 7
Joined: Mon Sep 10, 2007 6:03 pm

Re: menudata js to noscript menu converter

Post by Dijkman »

Think there is a litle flaw in the dataminer.php script
if there is a url and a showmenu in the aI line
only the showmenu is linked

Honda not linked should be linked to a website (it is in the javascript version off the menu)

* Honda Shadow Club Nederland
* Honda Shadow Owners Club Nederland
* Honda Gold Wing Club Nederland
* Honda Magna Club Nederland

see http://www.snipperdag.com
Dijkman
Beginner
Beginner
Posts: 7
Joined: Mon Sep 10, 2007 6:03 pm

Re: menudata js to noscript menu converter

Post by Dijkman »

Hello

i changed
modified dataminer.php => function outputSitemapItems($mnu)
to correct above flaw ai(text showmenu and url) = url is not linked in sitemap

http://www.gravomaster.com/om/menu.php

Code: Select all




function outputSitemapItems($mnu)
{
	global $_M,$dataMinerOutput;
	$dataMinerOutput.="<UL>\n";
	$items=$_M[$mnu]['items'];
	for($a=0;$a<count($items);$a++)
	{	
		$dataMinerOutput.="<li>\n";
		if(isset($items[$a]['showmenu'])&&$items[$a]['showmenu'])
		{	

//Changed www.snipperdag.com aI(text showmenu and url 16 September 2007			
			if(isset($items[$a]['url'])&&$items[$a]['url'])
			  
			{
				$dataMinerOutput.="<a href=".$items[$a]['url'].">".$items[$a]['text']."</a>\n";
			}
		        else{
				$dataMinerOutput.=$items[$a]['text']."\n";
			}
//Changed www.snipperdag.com  aI(text showmenu and url)  url was not linked 16 September 2007                                                             

			outputSitemapItems(getMenuByName($items[$a]['showmenu']));
		


}
		else
		{
			if(isset($items[$a]['url'])&&$items[$a]['url'])
			{
				$dataMinerOutput.="<a href=".$items[$a]['url'].">".$items[$a]['text']."</a>\n";
			}
			else
			{
				$dataMinerOutput.="".$items[$a]['text']."\n";
			}
		}
	}
	$dataMinerOutput.="</UL>\n";
}unction outputSitemapItems($mnu)
{
	global $_M,$dataMinerOutput;
	$dataMinerOutput.="<UL>\n";
	$items=$_M[$mnu]['items'];
	for($a=0;$a<count($items);$a++)
	{	
		$dataMinerOutput.="<li>\n";
		if(isset($items[$a]['showmenu'])&&$items[$a]['showmenu'])
		{	
//Changed www.snipperdag.com aI(text showmenu url 16 September 2007			
			if(isset($items[$a]['url'])&&$items[$a]['url'])
			  
			{
				$dataMinerOutput.="<a href=".$items[$a]['url'].">".$items[$a]['text']."</a>\n";
			}
		        else{
				$dataMinerOutput.=$items[$a]['text']."\n";
			}
//Changed www.snipperdag.com  I(text showmenu url)  url was not linked 16 September 2007                                                             
			outputSitemapItems(getMenuByName($items[$a]['showmenu']));
		


}
		else
		{
			if(isset($items[$a]['url'])&&$items[$a]['url'])
			{
				$dataMinerOutput.="<a href=".$items[$a]['url'].">".$items[$a]['text']."</a>\n";
			}
			else
			{
				$dataMinerOutput.="".$items[$a]['text']."\n";
			}
		}
	}
	$dataMinerOutput.="</UL>\n";
}

http://www.gravomaster.com/om/menu.php
Post Reply