Hi
Is there a way to show only events from one specific group (not eventcategory) in the module?
regards
Rolf
Hi, Rolf.
Yes, it could be done :)
Copy this file:
ROOT/modules/mod_community_events/tmpl/default.php
to:
ROOT/templates/your-template/html/mod_community_events (if you don't have "html" or "mod_community_events" folders, feel free to create them)
Now just replace all from lines 12 to the end of file with this:
<div>
<div class="app-box-content">
<ul class="cThumbDetails cResetList">
<?php foreach ($events as $event) { ?>
<?php if($event->contentid == 8) { ?>
<li <?php if (!empty($event->summary)): ?>class="jomNameTips" title="<?php echo CStringHelper::escape($event->summary); ?>" <?php endif; ?>>
<b class="cThumb-Calendar cFloat-L">
<b><?php echo CEventHelper::formatStartDate($event, JText::_('M')); ?></b>
<b><?php echo CEventHelper::formatStartDate($event, JText::_('d')); ?></b>
</b>
<div class="cThumb-Detail">
<a href="<?php echo $event->getLink(); ?>" class="cThumb-Title"><?php echo CStringHelper::escape($event->title); ?></a>
<div class="cThumb-Location">
<?php echo CStringHelper::escape($event->location); ?>
</div>
<div class="cThumb-Members small">
<a href="<?php echo $event->getGuestLink(COMMUNITY_EVENT_STATUS_ATTEND); ?>">
<?php echo JText::sprintf((!CStringHelper::isSingular($event->confirmedcount)) ? 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_MANY' : 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT', $event->confirmedcount); ?>
</a>
</div>
</div>
</li>
<?php } ?>
<?php } ?>
</ul>
</div>
<div class="app-box-footer">
<a href="<?php echo CRoute::_('index.php?option=com_community&view=events'); ?>"><?php echo JText::_('COM_COMMUNITY_FRONTPAGE_VIEW_ALL_EVENTS'); ?></a>
</div>
</div>
<?php if($event->contentid == 8) { ?>
Hi Michal
We have one private group for club users and the modified module should show the events only for that club group. But there are many other groups with "public" events and the "original" module should still show those events.
Does this modification allow that the "original" module is still working and shows events from all groups (except the private one)? Or is it an override?
regards
Rolf
Hi, Rolf.
Well, this modification will change how module woks... yes, it's a drawback I mentioned before.
But don't worry :D Magic Mike has cure for it ;)
Please use my fix (attached).
Make safe copy of original files first!
Upload it to: ROOT/modules/mod_community_events (replace original ones as you have - I hope - a safe copy of them).
Now you able to use a great feature of alternative layouts in module :)
Copy this file:
ROOT/modules/mod_community_events/tmpl/default.php
to:
ROOT/templates/your-template/html/mod_community_events (if you don't have "html" or "mod_community_events" folders, feel free to create them) and rename it to, lets say name-of-group.php and use my code inside.
Then browse to: Backend -> Extensions -> Modules and find Community Events module.
Then in tab Advanced you'll find additional dropdown list:
prntscr.com/3jowos
Select: say name-of-group
Now this module will display events only for that group.
Want to have module with original display? Just select default on the list.
Want to have the same module but with different group?
Just make a copy of: name-of-group.php rename it and change groupid inside file.
Then copy Community module in backend and select new layout name from dropdown list.
Sky is the limit now :)
Yeah!! Magic Mike is on the right way!!! ;-) This would be a cool solution which many other users are waiting for...
But i have a strange issue after implementing this...
First, the original module with default template is ok.
The modified template/module works if i choose group id 16. If i choose group id 17 which is trhe one i need or 18 for testing the module is empty. In both groups are upcoming events. 16 is a private group, 18 not.
This makes not really sense... Any idea, dear Magic Mike? :-)
regards
rolf
Hi, Rolf.
Well, private group events will be not shown that way as they have display restrictions.
Please show wide print screen of _community_events table... or provide me with PHPMyAdmin credentials.
Hi Michal
Provided you with PHPMyAdmin credentials... ;-)
regards
Rolf
Hi, Rolf.
I don't see them...
You need to edit your first post and add them to Miscellaneous field.
done....
Hi, Rolf.
DB is ok... I tried to investigate customized file... but every time I lost connection ... so I can't do anything on your site...
Is this a kind of security?
Hi Michal
Thank you very much for your investigation! I had to talk with the hoster.
But i'm away for the next 4 weeks. So if it's ok for you, we "freeze" this and i will contact you when i'm back.
Have a nice time!!!
Rolf
Hi, Rolf.
We have not received any response back from you in over 7 days, and would like to know if you consider this issue to be resolved. If you have any further questions, simply reply to this post.
Can you give me your IP-Address or range? I had to give it to my hoster... ;-)
Hi, Rolf.
192.168.1.100