Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Is there a way not to show the map for some events?

9 years 6 months ago
  • Andrew's Avatar
    Topic Author
  • Andrew
  • Visitor
  • Thank you received: 0
Licenses:

Most of my events will use the map, but some of them are going to be "on-line" only and so for those they shouldn't have a map. As far as I can see I have to type in a location always for events (perhaps because it is set to display map in back end?) but I want to be able to set the location to "On-line" and if I do that it still shows a location (somewhere in Canada!)

9 years 6 months ago
Licenses:

Hi, Andrew.

Yes, there is :) You may try one of Magic Mike template hacks ;)

Copy this file:

ROOT/components/com_community/templates/default/events.viewevent.php

to:

ROOT/templates/your-template/html/com_community (if you don't have "html" or "com_community" folders, feel free to create them)

Edit file and replace this (lines 287-292):

<!-- Event Location -->
								<dt><?php echo JText::_('COM_COMMUNITY_EVENTS_LOCATION');?></dt>
								<dd id="community-event-data-location">
									<a href="http://maps.google.com/?q=<?php echo urlencode($event->location); ?>" target="_blank"><?php echo $event->location; ?></a>
								</dd>
								<!--Event Occurence -->

with this:
<!-- Event Location -->
								<dt><?php echo JText::_('COM_COMMUNITY_EVENTS_LOCATION');?></dt>
								<?php if($event->location != 'On-line Event') { ?>
									<dd id="community-event-data-location">
										<a href="http://maps.google.com/?q=<?php echo urlencode($event->location); ?>" target="_blank"><?php echo $event->location; ?></a>
									</dd>
								<?php } else { ?>
									<dd id="community-event-data-location">
										<?php echo $event->location; ?>
									</dd>	
								<?php } ?>
								<!--Event Occurence -->

And this (line 381 after previous change)
if(CMapping::validateAddress($event->location)){

with this:
if(CMapping::validateAddress($event->location) AND $event->location != 'On-line Event'){

!IMPORTANT!

This hack will work ONLY if you type "On-line Event" as EVENT LOCATION. It must be EXACTLY On-line Event !

What this hack do?

It checks if in location field is typed "On-line Event". If yes then no map is displayed and Event Location in Event details is "On-line Event" also. But still if you type some location e.g Berlin, map for event will be displayed.

I attached demo file.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you

This message has an attachment file.
Please log in or register to see it.

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW