How do I use this module?
Ive just updated to the latest version and my rounded corners have stopped working. Ive read the documentation but im still confused.
It says something about 'copy this code snippet to your custom module'. Do I need to create a custom module or does this module include a place for the code? Im assuming there is no longer a UI?
Thanks
Comments
Comment #1
amitaibu> Do I need to create a custom module
Yes. And then you need to place the code inside a function. If you'd like to round corners to happen on every page you can place it in hook_init(). So, if your module's name is foo,then:
Comment #2
mshepherd commentedI've got the same problem.
I've been using this module for a while. And now in order to carry on using it, I've got to write my own module?
There was a UI before. Where's that gone?
This seems like quite a regression to me...
Can I still download the old verison?
Comment #3
jdln commentedOK thanks. Do you know if the current version will have a UI like the last release at some point? At the moment ive gone back to using the 6.x-2.0 as the UI is so convenient.
Comment #4
mshepherd commentedI agree.
While I understand the attraction of opening up the module as an API, losing the UI is a big backward step in my opinion.
For now, I've gone back to 2.0.
Comment #5
amitaibuYou may still use the 2.x version if you are more comfortable with it, although - at least for me - the fact that 3.x is in code (i.e. exportable) is more important than a UI.
With that said, there could be a UI as a separate module (i.e. rounded_corners_ui), but I have no plans for it yet, unless someone would like to sponsor my work.
Comment #6
director87 commentedI understand the work, but I understand the need for a UI.
If I can help out, I'll try to.
Comment #7
amitaibu@director87,
Great, the idea is to add a menu item, that shows a form a user may add round corners, but not inside a textarea with freetext, but through selections restricted to the options provided by the API.
Comment #8
director87 commented@Amitaibu I'll give it a go and post my work here.
Comment #9
bennash commentedsubscribing. I'm also a little frustrated with this upgrade path, but willing to help, after getting familiar with the new approach. Thanks for everyones work here.
Comment #10
jimmb commentedI updated Rounded Corners, and then needed the additional info. in this post! After reading it, I made a custom module using these instructions.
The code I previously had in the UI was:
Following the "README" instructions, inside my menucorners.module" I put:
However, after I enabling the module I get this message:
"Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/ddhfb/public_html/sites/all/modules/menucorners/menucorners.module on line 9"
Line 9 is:
I'm not a PHP coder, so I'm not sure what needs to be changed. But I think I applied my settings correctly to the example code... Anyway, some help will be much appreciated!
Jim
Comment #11
amitaibuI see the problem. The readme has a missing - ' after the word "width" and "selector".
The line should be:
I'll fix the README.
Comment #12
jimmb commentedHi Amitaibu,
Thanks for the reply. I just made that change on line 9, and uploaded the custom module again. However, now I'm getting a new error:
"Fatal error: Call to undefined function rounded_corners_add_corners() in /home/ddhfb/public_html/sites/all/modules/menucorners/menucorners.module on line 10"
Line 10 is:
UPDATE:
Oops - somehow the Rounded Corners module was removed during all of this. Re-uploading it fixed my problem.
Comment #13
dzahler commentedjimmb, I just came across this post...
In the future, I would add the following to the module's .info file:
This will ensure that rounded corners is enabled before enabling your module and thereby eliminating the chance of having the last error.
Comment #14
jimmb commentedThanks for the advice David. I just added that to my .info file...
Regards,
Jim
Comment #15
john franklin commentedThe easier way to use this module is to add the code snippet to
THEME_preprocess()in your theme'stemplate.phpfile.Comment #16
pcambraIn the wiki documentation states that you can add this in the preprocess of your template, but I couldn't get it working, only in a custom module's hook_init, is this right?
Comment #17
amitaibu> only in a custom module's hook_init, is this right?
No, you can put it on any function you want -- hook_init will make sure it will happen on every page, but that is not always the case. The advantage of turning this module into an API, is that it can be conditionally loaded.
You can also add it in your template.php preprocess, but you might need to add this line in the end of that function:
See more about this here -- http://www.drupaler.co.uk/blog/joys-preprocessing/70
Comment #18
mshepherd commentedJust to tie together some of the posts above.
I've got this working by adding the following into my theme's template.php file. If you use this, change MYTHEME to the name of your theme. Also, be sure to use an appropriate selector. I used '#block-views-nodequeue_1-block li'
My theme is a subtheme of Fusion core, so I had to create a template.php in my subtheme's directory.
I have another subtheme of this subtheme and it was comforting to notice that my rounded corners were correctly inherited by the sub-subtheme.
Comment #19
jdln commentedThe last post works for me, but how can I apply rounded corners to a 2nd div?
Thanks
Comment #20
jdln commentedWorks with this:
Comment #21
optimusprime619 commentedare there further details on the commands array options we pass for the rounded corners, similar to the original js in malsup site?
Comment #22
jdln commentedIf I understand what you saying then yes, i think so. Look at this from the documentation:
http://groups.drupal.org/node/5455
Comment #23
mshepherd commentedJust to expand a little on my previous post - here's an example of how you can add further options and more than one selector:
Hope that helps.
Comment #24
optimusprime619 commentedhi thanks for the details...just like above i targeted my anchor tag like
but the rounded corner effects all the four corners and not just the top left and right corners....so was wondering what i might've done wrong..happens both on IE7 and FF 3.6, though one with extra div's and the other with -moz-border-radius on all 4 corners..being a noob that i am one would never know if its me who's doing things wrong or if its something else... :)
Comment #25
pitxels commentedMy drupal alerted me to update this module to the 6.x-3.0-alpha1, so I did just to find out this is broken, and there is no UI, where is the improvement here? This module was working ok, why not make a different module for that API?
Of course I can use the old version, but why promoting an upgrade?
I am really thankful for version 6.x-2.0
Comment #26
tonyhrx commentedI was used to version 2 also and had a bit of a headache trying to get the new one to work. The best advice is at 23 - works fine.
One problem with the version 2 was that it completely broke CiviCRM javascript functions so the new one, though a bit obscurely documented is a better version for that reason alone.