Closed (fixed)
Project:
Automodal
Version:
6.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2010 at 23:32 UTC
Updated:
3 May 2012 at 21:12 UTC
I am using automodal successfully for pages, and Images, but I would like to customize the width and height of the window so my image can be displayed in full size, I would be nice to just add this on the class....
Comments
Comment #1
tpainton commentedYou can use a custom size window using automodal_add() and set the width option.
Comment #2
zdean commentedWhere would this code go? I tried in the template.php and page.tpl.php and had no effect from either.
Thanks in advance.
Comment #3
feuillet commentedWould like to know that too, the documentation doesn't cover that.
Comment #4
bshensky commentedI can understand that the automodal_add() should be specified in a custom hook prior to the form or page render (I'm looking at you, hook_form_alter() and hook_view()), but I don't know what I'm /selecting/. What is .myselector?
Comment #5
giorgoskcreate custom module in my example alterations is the module name
alterations.info file
alterations.module file
put files in sites/all/modules/alterations folder
and go in admin/build/modules
and enable it
can change following variables
* - autoFit: Whether the window should automatically fit to the window.
* Defautlts to TRUE.
* - draggable: If the dialog is draggable. Defaults to True.
* - width: The width of the dialog in px. Defaults to 600.
* - height: The heigh of the dialog in px. Defaults to 400.
* - automodalClose: On form submissions close the modal window. Default True.
* - automodalReload: Reload the page on form submission. Depends on automodalClose
* set to TRUE. Defaults to FALSE.
* - automodalRedirect: Redirect to a new location. Depends on automodalClose
* being set to TRUE. This should be a fully qualified url.
Comment #6
capellicThe solution in #5 is great if you want to override the existing selector, but if you want a new one, you should add it to your template.php. I don't know why @zdean in #2 had that problem. It also works in the tpl file.
Would be nice if they made it clear that this is a themeing function in the documentation and at the top of the automodal_add() function description in automodal.module.
Thanks for this GREAT module!
Comment #8
ehalber commentedI was having the save issues as #2 @zdean. This is what I did to fix it.
I placed the automodal_add() function in my theme's template.php file. The trick is to change the class name. The default install uses 'automodal'. Once you change this you're golden.
Works like a charm now :-) Hope this is helpful to and noobs out there.
Comment #9
modctek commentedFor the life of me, I cannot get any of this to work except building the custom module to override the default "automodal" class selector. I need to add multiple window sizes, but cannot seem to get anything except "automodal" to work. Can someone explain in painful newbie detail how to add either function mentioned above to template.php?
Comment #10
modctek commentedOK, I knew if I posted I would soon-after stumble upon the solution all by myself. For me (your mileage may vary), I need to add the following code to my template.php file above the functions.
Comment #11
modctek commentedSomething else to note: if you are using modalframe-exclude as one of your class selectors (eg. going from modal to modal), your custom class selectors will not work.
I don't know how to fix this, as the URL arguments "height" and "width" nor "autoFit" do not work.
Comment #12
serguitus commentedSolution in #5 worked very well for me.
1 thing to note, it didn´t resize to my specified width until I added
$settings['autoFit'] = False;
it was just a Note :)
thanks for the great automodal!
PD: I steel think that it would be better for themers if you just add css classes with js and edit things in css file. I will look arround to see if this is possible and if I´m lucky, I will post here