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) »
  • Styling Events Based on Event Type
Pages: [1]

Author Topic: Styling Events Based on Event Type  (Read 677 times)

screeno

  • I’m new here
  • *
  • Posts: 6
  • Karma: 1
  • CiviCRM version: 4.4
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.29
  • PHP version: 5.4.10
Styling Events Based on Event Type
September 05, 2014, 03:16:49 pm
Hello,

I am running CiviCRM 4.4.6 with Drupal 7.31 and the CiviCRM Events view.  My client would like to style events differently based on the event type. In particular, they would like to style the events that they are not hosting differently from the event that they do host.  I examined several events using Firebug and did not see a class identifying the event type.  Any helpful suggestions would be greatly appreciated.

Gilbert

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Styling Events Based on Event Type
September 05, 2014, 03:33:27 pm
I'm sure the template has the event type available, so it's just a matter of adding it to the markup. Want to submit a pull-request for this?
Try asking your question on the new CiviCRM help site.

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: Styling Events Based on Event Type
September 05, 2014, 03:47:18 pm
When I enable debugging (Administer menu > System Settings > Debugging and Error Handling then enable Smarty Debugging (e.g. http://localhost:8001/civicrm/event/register?reset=1&id=3&smartyDebug=1), I see {$event['event_type_id']} as a Smarty variable.  If you're fine with using the id, it should just be a matter of adding that to an appropriate div in CRM/Event/Form/Registration/Register.tpl and/or CRM/Event/Page/EventInfo.tpl.  Hope that helps toward a pull request!
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Styling Events Based on Event Type
September 05, 2014, 03:50:03 pm
It should not be hard to look up event type from id and assigning that to the tpl. I think name would be better than id for a css class.
Try asking your question on the new CiviCRM help site.

screeno

  • I’m new here
  • *
  • Posts: 6
  • Karma: 1
  • CiviCRM version: 4.4
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.29
  • PHP version: 5.4.10
Re: Styling Events Based on Event Type
September 08, 2014, 05:00:45 am
I need a little more information.  I don't know what a pull request is, please explain. Also, is it possible to get an email notification when there has been any activity on this thread?

Thanks,
Gilbert

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: Styling Events Based on Event Type
September 08, 2014, 01:13:41 pm
Quote from: screeno on September 08, 2014, 05:00:45 am
Also, is it possible to get an email notification when there has been any activity on this thread?
There should be a Notify option at bottom.
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

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Styling Events Based on Event Type
September 09, 2014, 01:49:13 am
A pull request is the way that you get any changes that you have made into core CiviCRM.  Put very simply: you 'clone' (i.e. create a local copy) of CiviCRM's code, make the changes you want, create a pull request, and someone reviews it, and adds it to core.

Appreciate that If you aren't that familiar with version control and software development, that might not make much sense to you. If you want to get familiar with it, then this is probably a great way to start. If not, you might want to pass this on to a colleague, etc. that does.

Hope that is helpful.

Michael
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

screeno

  • I’m new here
  • *
  • Posts: 6
  • Karma: 1
  • CiviCRM version: 4.4
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.29
  • PHP version: 5.4.10
Re: Styling Events Based on Event Type
September 09, 2014, 11:32:03 am
I was able to achieve what I set out to do.  ;D I didn't have to go so far as to hack the civicrm core.  I used the Drupal module Views PHP - https://www.drupal.org/project/views_php.  I was able to add a field to my view then used a conditional statement to identify the event id I needed to target.  I echoed a span tag with a class that I then styled with css.

Thanks for the responses.
Gilbert

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Styling Events Based on Event Type

This forum was archived on 2017-11-26.