Some of the args don't work when used as URL arguments.

automodalReload works just fine. Example:

<a class="automodal" href="/user/login?automodalReload=true">log in now</a>

However height and autoFit don't seem to work. Example:

<a class="automodal" href="/user/login?automodalReload=true&height=265&autoFit=FALSE">log in now</a>

or even just:

<a class="automodal" href="/user/login?height=265">log in now</a>

I'm trying to set the height along with the link to avoid the autoFit animation.

If those attributes are not designed to work as URL arguments, then this could be categorized as a feature request.

This issue was transferred from: #1253716: Documentation for link arguments

Comments

modctek’s picture

subscribing

gooddesignusa’s picture

I know this is most likely not the correct way to do this but it works. I wasn't able to figure out how the other args were working so I just did it this way.
Inside the js file goto the line that reads
settings.url += 'automodal=true';
paste this right under

link_href = $(this).attr('href');
var vars = [], hash;
var hashes = link_href.slice(link_href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
  hash = hashes[i].split('=');
  vars.push(hash[0]);
  vars[hash[0]] = hash[1];
}
if(vars["width"]){
  settings.width = Number(vars["width"]);
}

I would imagine for height you would do what I did for width. I didn't have time to make a patch right now. I didn't really bother since this is more of a temp fix until the module author fixes this issue.

i found the code to get the query pram's from http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-with-...

gooddesignusa’s picture

Issue summary: View changes

Added link to previous issue.

dsnopek’s picture

Title: Some arguments do not work when used in link URL. » Allow height and widgth to be specified in the link
Version: 6.x-1.0 » 6.x-1.x-dev
Category: Bug report » Feature request
Issue summary: View changes

This is an interesting feature idea, thanks! I'm not sure it'll be with GET arguments (because the page has to be fully loaded for those to have an effect and the modal is shown right away) but it could be done with some other property on the link. For now, you can modify this in Javascript with Drupal.automodal.settingsAlter in a custom module.