CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Restrict a drupal block on pages that show a google map - Help please
Pages: [1]

Author Topic: Restrict a drupal block on pages that show a google map - Help please  (Read 1946 times)

Chris7789

  • Guest
Restrict a drupal block on pages that show a google map - Help please
September 16, 2009, 02:07:48 am
Hello,

Any help would be greatly appreciated. I did post this on the drupal forums but people seem to be staying away. Maybe because civiCRM is in the path.

I would like to restrict a block to not show at the same time as viewing any google maps.

The path below can be restricted by adding this: civicrm/profile/*  to 'show on all pages except'

/index.php?q=civicrm/profile/map&reset=1&cid=2030&gid=9

However there is another path to viewing a map which is:

/index.php?q=civicrm/profile&_qf_Search_display=true&map=1

Any ideas what I could put in to restrict the block showing on the path above?
I tried: civicrm/profile* and this works but also restricts the block showing on the profile search pages which is no good.

Again any help would be great.

Thanks

Chris

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Restrict a drupal block on pages that show a google map - Help please
September 16, 2009, 02:55:53 am
I would use "Show if the following PHP code returns TRUE" option with the code like -
Code: [Select]
<?php 
    $args 
= explode( '/', $_GET['q'] );
    if ( 
$args[0] == 'civicrm' &&  $args[1] == 'profile' &&
         (
$args[2] == 'map' || $_GET['map'] == 1) ) {
        return 
false;
    }
    return 
true;
?>

Note you might need to add extra checks to ensure those keys (0/1/2/map) exists to avoid any php warnings.

I tried playing with url matches like "civicrm/profile*map=1*" etc, but didn't work, might be because there is some other way of matching query params (or not supported). Let me know when when you come to know :)
« Last Edit: September 16, 2009, 02:58:17 am by Deepak Srivastava »
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Chris7789

  • Guest
Re: Restrict a drupal block on pages that show a google map - Help please
September 16, 2009, 07:01:19 am
Hi Deepak,

That has worked a treat. Thankyou very much!  ;D

Chris7789

  • Guest
Re: Restrict a drupal block on pages that show a google map - Help please
September 16, 2009, 01:28:46 pm
I have just noticed that I have lost some civiCRM functionality on the path below:

/index.php?q=civicrm/profile&_qf_Search_display=true&map=1

Its actually the 'done' button that returns you to the listings page thats missing.

Could this be anything to do with the PHP?

Thanks for any further help.

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Restrict a drupal block on pages that show a google map - Help please
September 17, 2009, 12:39:34 am
Quote
Could this be anything to do with the PHP?
You mean block's php code ? Don't think so. Try removing and check.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Chris7789

  • Guest
Re: Restrict a drupal block on pages that show a google map - Help please
September 17, 2009, 04:44:25 am
Hi,

Ok does not seem related to the PHP we added to the block. Will look into other causes.

Thanks for the help. Much appeciated.

Chris

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Restrict a drupal block on pages that show a google map - Help please

This forum was archived on 2017-11-26.