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) »
  • Views event block based on date argument
Pages: [1]

Author Topic: Views event block based on date argument  (Read 1135 times)

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Views event block based on date argument
August 03, 2009, 03:13:06 pm
I am trying to insert a civi_view into a drupal node automatically using viewfield module.  To do this, I need to create a block/page which is based on an argument.  The best (I think) way to do this is for the argument to be based on the event-date YEAR.  The reason for this is that the drupal nodes have both a year field in them, and the link has the year in it.  

For example: I have an annual meeting in 2011.  Its DRUPAL page is /annual-meetings/2011.  I would like this page to automatically pull by civi-block which for the 2011 event information.  It seems logical that I could do this by creating the civi-block view, and making an argument which filters on the YEAR of the start/end date.  This then inserts the view only on those pages which have the same YEAR in the URL.  

But...I can't see how to do this in the argument field within views. I.e., I can't create an argument that restricts by the event start/end year, UNLESS:

I create a default argument using PHP which looks for a match between event-start-date year and the year in the URL or in the drupal note itself (this latter requires a relationship which is not currently allowed between civi-views and drupal nodes).  I have no idea how to even begin doing this.  Any suggestions are welcome!

maria

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Views event block based on date argument

This forum was archived on 2017-11-26.