By gtcaz on
Hi all.
I have a list of upcoming events. I don't use any kind of classification for my events -- they're all of the same type.
Under the Upcoming events block, they're listed like this:
Sample event!
(5 days) (event)
Is there any way to get rid of the useless (event) tag?
Are there any other ways to customize the display -- for example, can I add the actual date of the event instead of either the (5 days) or the (event)? E.g.:
Sample event!
August 1, 2006 at 5:30pm
Thanks for any help!
Comments
Removing (event) in event.theme
Hello,
Removing the (event) tag can be done in the event module.
In in the event modules dir there is event.theme file in this file there is a line---
Current line
$output .= ''. t("($node->typename)") .''
just comment this line and the tag will be removed.
// $output .= ''. t("($node->typename)") .''
Regards,
Hitesh
Thanks!
Thanks!
Here's what I ended up doing -- looks much better on my site:
Can you post your site's
Can you post your site's link to view the changes.
Even i will consider on changing on my site to
www.ilaaka.com
Regards,
Hitesh
I've implemented gtcaz's
I've implemented gtcaz's change (thank you all) at www.walkerstalk.com :)
I forgot to include timezone
I forgot to include timezone offsets. My site is always MST (-7) so I hardcoded that in. Slowly trying to hack a better solution. This really needs to be moved into the config panel.
EDIT: I really don't know what's up. In my test box (XAMPP) I the timezone is correct with no adjustment. On my server (set to UTC with the correct offsets set through Drupal) my upcoming events block dates are not adjusted for the offset. Strange.
Where did u put that code,
Where did u put that code, gtcaz?
Did u replace your whole event.theme with that?
No -- just comment our the
No -- just comment our the lines like I did above and add the new formatting line. Better yet, solipsists' example that handles timezones correctly from here: http://drupal.org/node/78271
I think the function is at around line 480.
Thanks a lot. Works
Thanks a lot. Works perfectly.
event.theme modification working in v4.7.3?
Is your modification to event.theme working in drupal v4.7.3? I tried it, and no events were displayed. Thanks!
grouping
this is great; but by any chance can somebody figure out how to group these event items in the upcoming block by the date, rather than displaying the date under each event? i used it for a gig guide, so i have 5+ events most days...
Thanks!
This is a fantastic little snippet. I've modified it to get rid of the year, but apart from that I love it!
That's exactly what I was
That's exactly what I was looking to do.
Thanks
Overriding the theme would be probably be even better
Thank you for this post, it helped me find the relevant code.
I'd suggest OVERRIDING the _theme function instead of commenting out a line in the event module's ".theme" file.
function theme_event_upcoming_item($node)to
function phptemplate_event_upcoming_item($node)(Assuming you are using a phptemplate theme. Otherwise, i think you can just use [your-theme's-name]_event_upcoming_item($node)
This way, if you ever have to update the event module code, re-install it, etc you won't lose the modifications.
doesn't appear to work
I'm using the default garland theme. All functions are phptemplate_ prefix. I added the revised functions exactly as you described and it didn't change the display. Only editing events.theme changed the display.
Is there a difference in 5.1 ?
--
Jo Rhett
Net Consonance
Date format
The code is working perfect, except the date format function should be used.
I adapted the code to my needs as follows:
function aurora_event_upcoming_item($node) {
$output = '' . format_date($node->event_start, 'custom', 'd/m/y');
$output .= '
' . l($node->title, "node/$node->nid", array('title' => $node->title));
return $output;
}
Date format
The code is working perfect, except the date format function should be used.
I adapted the code to my needs as follows:
function theme_event_upcoming_item($node) {
$output = '' . format_date($node->event_start, 'custom', 'd/m/y');
$output .= '
' . l($node->title, "node/$node->nid", array('title' => $node->title));
return $output;
}
Date format - next try
Seems some problems with adding the comment properly. Next try for my code:
how you get two fields to run together on the same line
I have used this and it works well. Unfortunatly the title and time left fields are on seperate lines, wasting space. Could anyone tell me The code is currently
function theme_event_upcoming_item($node) {
$output = l($node->title, "node/$node->nid", array('title' => $node->title));
if ((event_get_types('all') + event_get_types('solo')) > 1) {
}
$output .= '('. $node->timeleft .')';
return $output;
}
how to show the event start without time
I was able to showing the date of the upcoming events (using event 5.2x-dev using the following
But i would like to show the start date without the time.
Note: The other codes offered above do not work in event 5.2x-dev. It is true that only the date is shown, however, the date reverts to 1/1/70.
Any ideas?
Remove it via css?
I needed to remove (event) from upcoming events, AND the monthly calendar. I found that by changing this (in the event.css file):
to this:
did the trick.