Hi,
I'm not sure of the best way to go about this. I'm using the menu for a catalog that contains lots of long query strings as links, with the only difference in the string being one parameter (like subcat=10, subcat=5, etc.)
I could cut down the file size a lot if there was a way I could set a default for most of the string and then just tack on the different ending for each menu listing.
Any ideas how I could best incorporate this into the Milonic framework?
Thanks,
Derek
putting a script function in the url= parameter
I know you can use a function in the url parameter, however, I am not a function person. I don't know how to create one. If you know how to make functions, then maybe the following example can give you some direction.
The function relates to opening a new window in a particular position and it is called in the url parameter:
Then in the aI string you'd have this to get it to trigger:
I'm sorry I can't more directly answer your question
Ruth
The function relates to opening a new window in a particular position and it is called in the url parameter:
Code: Select all
var newwindow;
function poptastic(url)
{
newwindow=window.open(url,'name','height=500,width=400,left=100,
top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
}
Code: Select all
aI("text=item;url=javascript:newwindow('http://whatever/');");
Ruth
Hi Derek,
Since menu_data.js is all javascript and the parameter passed to Milonic's aI() function is a string (often referred to here as the "aI string"), you could use js string concatenation when building the string to pass to aI(). For example, suppose your base url was:
http://www.mysite.com/products/catalog.html?subcat=
You could define the base url in a global string variable at the top of your menu_data.js file, like so:
Then when you want to build an aI string for a menu item, you'd define the static properties at the beginning of the string (like text=... status=... etc.), then concatenate the baseUrl variable to the aI string, then concatenate the value of the parameter you want to pass at the end of the aI string, like so:
(You could skip the space on either side of the + operator if you want to save even more space... no pun intended). The resulting url for the menu item defined above would be:
http://www.mysite.com/products/catalog.html?subcat=10
Of course, you'd want to modify the approach to suit your own particular URLs.
Hope that helps,
Kevin
Since menu_data.js is all javascript and the parameter passed to Milonic's aI() function is a string (often referred to here as the "aI string"), you could use js string concatenation when building the string to pass to aI(). For example, suppose your base url was:
http://www.mysite.com/products/catalog.html?subcat=
You could define the base url in a global string variable at the top of your menu_data.js file, like so:
Code: Select all
var baseUrl = "http://www.mysite.com/products/catalog.html?subcat=";
Code: Select all
aI("text=Item Text;url=" + baseUrl + "10;");
http://www.mysite.com/products/catalog.html?subcat=10
Of course, you'd want to modify the approach to suit your own particular URLs.
Hope that helps,
Kevin