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) »
  • Display [url] without http
Pages: [1]

Author Topic: Display [url] without http  (Read 580 times)

groston

  • I post occasionally
  • **
  • Posts: 61
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.34
  • PHP version: 5.3.27
Display [url] without http
June 25, 2014, 08:08:34 pm
It seems that this should be easy, but I have yet to discover a solution.

In a Drupal view, I want to display the field CiviCRM Website: Website URL. While this is easy, what is displayed is http://www.example.com. Is there a way to display this filed without the http://?

Please note that I am using a rewrite rule, specifically: <a href="[url]" target="_blank">[url]</a>
in order to be able to specify the target.

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: Display [url] without http
June 25, 2014, 08:14:42 pm
prob. stating the obvious but as it is stored in the db with the http - you would need some php magic (i guess) to remove that part of the string - beyond me ;-)
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

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Display [url] without http
June 26, 2014, 03:36:12 am
Yes, you can run PHP in your View template to remove the http:// if you want.
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.

groston

  • I post occasionally
  • **
  • Posts: 61
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.34
  • PHP version: 5.3.27
Re: Display [url] without http
June 26, 2014, 08:58:32 am
Thanks for the help. I am not comfortable editing the template file, so i created a Global: PHP field.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Display [url] without http

This forum was archived on 2017-11-26.