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 CiviEvent (Moderator: Yashodha Chaku) »
  • Formatting Event Listing Location Block
Pages: [1]

Author Topic: Formatting Event Listing Location Block  (Read 555 times)

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Formatting Event Listing Location Block
January 13, 2014, 10:11:32 am
I feel that I may be missing the blindingly obvious, but I can't seem to figure out how to get the Location block in an Events Listing to break lines, so that each line of the address appears as if on an envelope, for example:

Location Name
Address Line 1
City, State, ZIP

Right now it's all a huge run-on sentence.

Joomla 3.x
CiviCRM 4.4.x

Thanks in advance for pointing me in the right direction.
« Last Edit: January 13, 2014, 10:23:13 am by penguintrax »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Formatting Event Listing Location Block
January 13, 2014, 11:22:42 am
Can you do it with CSS? We would have to see the site to see what's going on...
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: Formatting Event Listing Location Block
January 13, 2014, 11:33:23 am
Sorry Hershel - here is the page:  http://www.bereadyflorida.org/workshops

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Formatting Event Listing Location Block
January 14, 2014, 02:51:14 am
The HTML there is also just one big "sentence" and so CSS won't help.

I'm not sure how to fix it--you might be able to edit the template in question but I'm not sure which it is.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: Formatting Event Listing Location Block
January 14, 2014, 08:33:05 am
I've looked at the iCalendar template and it's calling the location as a variable. The address shows up on 3 lines on the Event Info page using class 'adr'.

There is no class assigned to that column in the table, which is odd since the previous column (date) is using a class for styling. Maybe if I can figure out where to assign the adr class to that column, that will fix it. This appears to not be specific to this site, as I checked other sites' event lists and that same thing is happening there meaning it's a Civi default setting of some sort.

Similar issue seems to have been asked before, and not answered:

http://forum.civicrm.org/index.php?topic=20122.0



Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Formatting Event Listing Location Block
January 14, 2014, 05:23:06 pm

U'll need to modify / extend core to do this. Relevant files are:

CRM/Event/Page/ICalendar.php
CRM/Event/BAO/Event.php, function getCompleteInfo

if you do so, please do submit your changes back as an issue and a PR so other folks can benefit downstream

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: Formatting Event Listing Location Block
January 15, 2014, 07:05:55 am
I'm not a PHP Grrrl, but I'll see if I can muddle my way through and if so, upload it as an issue/fix.

Thanks Lobo and Happy New Year!

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: Formatting Event Listing Location Block
February 04, 2014, 12:20:19 pm
So, we have a 'fix' for this issue and I will add it to the Wiki if someone can tell me the best place to add the info, but for those that want to make this formatting change happen, here's what my dev did:

Code: [Select]
....administrator/components/com_civicrm/civicrm/CRM/Event/BAO/Event.php

look for the line (around line 831)
$addrFields = array(

and replace the following lines

 'address_name' => $dao->address_name,
          'street_address' => $dao->street_address,
          'supplemental_address_1' => $dao->supplemental_address_1,
          'supplemental_address_2' => $dao->supplemental_address_2,
          'city' => $dao->city,
          'state_province' => $dao->state,
          'postal_code' => $dao->postal_code,
          'postal_code_suffix' => $dao->postal_code_suffix,
          'country' => $dao->country,
          'county' => NULL,

with this


'address_name' => "<span class=\"address-name\">" . $dao->address_name . "</span></br>",
        'street_address' => "<span class=\"street-address\">" . $dao->street_address . "</span>",
        'supplemental_address_1' => "<span class=\"extended-address\">" . $dao->supplemental_address_1 . "</span>",
        'supplemental_address_2' => $dao->supplemental_address_2,
        'city' => "</br><span class=\"locality\">" . $dao->city . "</span>",
        'state_province' => "<span class=\"region\">" . $dao->state . "</span>",
        'postal_code' => "<span class=\"postal-code\">" . $dao->postal_code . "</span>",
        //'postal_code_suffix' => "<span class=\"postal-code-suffix\">" . $dao->postal_code_suffix . "</span>",
        'country' => "<span class=\"country-name\">" . $dao->country . "</span>",
        'county' => NULL,

As seen now on http://www.bereadyflorida.org/workshops

the span classes are not necessary, but they can definitely give more flexibility in the address styling

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Formatting Event Listing Location Block

This forum was archived on 2017-11-26.