Closed (won't fix)
Project:
Event Repeat
Version:
5.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Mar 2007 at 18:32 UTC
Updated:
17 Apr 2013 at 14:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
seanbfuller commentedIs it correct to assume you are talking about the weight of the event repeat field set in the node form? As I see it, the field set is just under event module's form elements. Please let me know what configuration you have where it is in the wrong place. It sounds like the issue is that you different weights on some CCK elements, but because eventrepeat is a nodeapi element, it does not have the option to change the weight?
You can always change the weight of that element in the theme, if that would help.
Comment #2
BobLouis commentedSean,
Thank you for your answer.
Yes, I am talking about the weight of the event repeat field set in the node form (I actually created a new content type, and gave it event "properties"). The field was indeed just under event module's form elements, before I managed to change the weight of these. So now the event repeat field set stands above all the other fields, in the submit form used to create content.
My config is Drupal 5.1, with event, event repeat, content template modules installed.
So you're saying that I can "change the weight of that element in the theme" : how do I do that? It seems that changing it in the theme will only work for displaying the node once it is submitted. I just need to change the weight of the event repeat field set within the submit form for that event.
Your help is appreciated !
Comment #3
seanbfuller commentedYou can check out http://api.drupal.org/api/4.7/file/developer/topics/forms_api.html for more information about theming a form page. Scroll down to the "Theming Forms" heading near the bottom of the page and look at point 2.
Your theme override function in template.php would probably look something like this:
I haven't tested this, so you might have to play with it.
You should be able to also create a phptemplate_eventrepeat_form function, but I'm not sure that this will stay a theme_ function as opposed to an internal (non-theme) function. You probably shouldn't use that.
Otherwise, if this should be a feature of the module, let me know.
Comment #4
BobLouis commentedThank you very much Sean: it works just fine now!
I used the following code:
Just for information, I replaced the 'form_render' function (which was not recognized) by 'drupal_render' function, as explained in the theming API documentation you mentioned.
To answer your question, I think it would be useful to include it as a feature in the module, especially for non-programmers like me! However, it's true that it's been pretty easy to "hack".
Thank you again very much for your support !
Comment #5
seanbfuller commentedNo problem. I'll leave this open for the time being, while we discuss the next steps for eventrepeat. At the very least, a simple "weight" setting seems like it will be useful.
And sorry about that form_render call. It was from 4.7 and was replace with drupal_render.
Finally, just to be precise, the "$output .=" might give you a php warning if you did not declare $output beforehand.
Cheers!
Comment #6
jsimonis commentedI'm having a bit of difficulty with this.
I have a template.php file that I'm using to declare additional regions.
So I added this to the file:
But obviously I'm doing something wrong, as the weight has not changed.
Any ideas?
I'm running 5.1 with events and event repeat. I'm using the basic event module to create my events.
Thanks!
Comment #7
seanbfuller commentedjsimonis,
I added a "This was themed" message in there and that worked. then I changed the weight to 20, and it moved the fieldset down. Looking at the surrounding elements, event start and event end have a weight of -15 and -14, and title has a weight of -5. You might not be noticing a big difference between -2 and -12. Consider putting a print_r($form); in your phptemplate_event_node_form function to see what it is doing.
Let me know if it works for you.
Comment #8
BobLouis commentedHello,
I've installed the last version of the eventrepeat module.
And now again in the forms, event repeat stands above the other fields, like it did before applying the following code into template.php (cf. above posts):
So now even with this code, event repeat is still above all the other fields.
Any idea of the problem?
Comment #9
Anonymous (not verified) commentedThis patch will set the eventrepeat fields to be one "unit" heavier than the weight of the "event" unit, so it will presumably appear directly below the event field.
Comment #10
Anonymous (not verified) commentedcheck http://drupal.org/node/145529 for a way to set the weight of the entire event module as well.
Comment #11
BobLouis commentedAnonymous5190 thank you for your patch. But it doesn't work for me:
I have the following error message:
Saved "rejects" are:
Since I'm not a programmer, could you explain what to do next?
Comment #12
Anonymous (not verified) commentedIt's possible that you have a different version of the module than me, so the patch may not be applicable at all. If you want to try anyway, probably the simplest thing to do is to back up eventrepeat.module and then edit it. Find the line that says
'#weight' => -12,
and change it to say
'#weight' => variable_get('event_weight',-15)+1,
I'm actually not using eventrepeat anymore (I switched to the date/time cck field combined with calendar module) so I can't really support this patch beyond that.
Comment #13
BobLouis commentedThank you. I actually solved my problem by editing the line directly, as you mentioned.
Comment #14
seanbfuller commentedI might be missing something obvious here, but I can't seem to find the event_weight variable setting in either the 5.x-1.0 or HEAD (which I believe is 5.x-2.x) versions of the event module. I'm obviously missing something obvious. Any hints are welcome.
As an alternative, would everyone prefer a simple option in the settings page to set the weight?
Comment #15
Anonymous (not verified) commentedThis whole patch is based off another patch I made to enable configurable weight for the event module - the event_weight variable is defined and customizable there, so you need that applied to the event module to take advantage of this patch to the event_repeat module.
Really, they should be combined into one, but since they affect different modules I listed this patch separately.
Comment #16
seanbfuller commentedWould a configurable weight for eventrepeat be a good way to go?
Comment #17
Anonymous (not verified) commentedYeah, but this patch combined with the one I previously linked should accomplish that, or at least allow the entire "block" of event-related fields to be custom-weighted. Are you trying to do something different that this doesn't work for?
Comment #18
rmiddle commentedNeed to look at how the weight field is setup in the current code.
Thanks
Robert
Comment #19
oadaeh commentedThis issue is being closed due to age and/or version. If this issue is still valid, please reopen it against the 6.x-1.x branch and update it. There will be no more follow ups against the 5.x branches.