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) »
  • Drupal View: organization name as URL parameter (example.com/organization-name)
Pages: [1]

Author Topic: Drupal View: organization name as URL parameter (example.com/organization-name)  (Read 558 times)

Brylie Christopher Oxley

  • I post occasionally
  • **
  • Posts: 52
  • Karma: 1
  • CiviCRM version: 4.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.x
Drupal View: organization name as URL parameter (example.com/organization-name)
August 09, 2014, 07:10:06 am
I would like to create a Drupal view that displays details about a specific organization. How can I construct the view context so that it takes the organization name from the URL parameter, e.g.?

http://domain.com/organization/organization-name

This would be helpful so that the URLs are search engine optimised, user friendly, can be bookmarked, etc.

Is there a different way of going about this?
Brylie Oxley
http://brylie.gnumedia.org

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Drupal View: organization name as URL parameter (example.com/organization-name)
August 09, 2014, 09:49:02 am
Hey Brylie,

This is what contextual filters are for.  Here's a pretty good intro:
http://www.metaltoad.com/blog/using-drupal-contextual-filters-views
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Drupal View: organization name as URL parameter (example.com/organization-name)
August 09, 2014, 03:51:16 pm
Hi Brylie - from the description it was not quite clear to me if you are only wanting to show civi data - or if you also want to have a node for each Organisation which might give you some more flexibility.

If the former then Jon has pointed in the best direct. However, as it wasn't immediately obvious to me how to do this, and as a Sunday morning challenge, instead of the sudoko/crossword/something, I had a quick poke. You will need a View based on civicrm contacts, possibly with two pages, one giving the list of all Orgs with links to other pages which use a Contextual Filter that looks for the Org name in the path.

If that all sounds like gobbledegook, then I added a sample View that you can download from what I hope will be a growing list of simple solutions in the Fuzion Treasure Trove  ;D here http://fuzion.co.nz/treasure-trove - or the specific example for this use case here http://fuzion.co.nz/blogs/showing-list-civi-contacts-view-and-providing-path-page-each-contact

If the latter then you can use the Civicrm Contact reference module to link the node to the civicontact - and then pull in a block of data about that organisation (which I will try and write up next Sunday).
But you can see an example of pulling Drupal and civi data together here
http://europeangreens.eu/parties/b%C3%BCndnis-90die-gr%C3%BCnen
where a bunch of the blocks (contact details, leaders, election results) are pulling in civi data, and another bunch eg News about Party is pulling in reverse node reference content - ie nodes that are 'node referencing' the Bundnis party via a node reference field on the News content type
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Drupal View: organization name as URL parameter (example.com/organization-name)

This forum was archived on 2017-11-26.