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 Profiles (Moderator: Dave Greenberg) »
  • Is There a Place to Store a Custom Version of civicrm/CRM/Profile/Page/View.php?
Pages: [1]

Author Topic: Is There a Place to Store a Custom Version of civicrm/CRM/Profile/Page/View.php?  (Read 1243 times)

farmrchrys

  • I post occasionally
  • **
  • Posts: 92
  • Karma: 2
    • Spokane Moves to Amend the Constitution (under development)
  • CiviCRM version: CiviCRM 4.4.6
  • CMS version: Drupal 7.31
  • MySQL version: MySQL 5.5.37
  • PHP version: PHP 5.3.28
Is There a Place to Store a Custom Version of civicrm/CRM/Profile/Page/View.php?
May 23, 2009, 07:29:17 am
I do not want the contact's display name to be included in the page title when viewing a profile listing as the result of a search. I was able to accomplish this by removing the lines indicated below in civicrm/CRM/Profile/Page/View.php:

Code: [Select]
//       $sortName = CRM_Core_DAO::getFieldValue( 'CRM_Contact_DAO_Contact', $this->_id, 'display_name' );
        $title    = CRM_Core_DAO::getFieldValue( 'CRM_Core_DAO_UFGroup', $this->_gid, 'title' );
//       if ( $sortName ) {
//            $title .=
//        }
        CRM_Utils_System::setTitle( $title );
    }

Is there a way to store a custom version of this page somewhere rather than tweaking the core?

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: Is There a Place to Store a Custom Version of civicrm/CRM/Profile/Page/View.php?
May 23, 2009, 07:51:38 am

Set a custom php path in: Administer CiviCRM >> Global Settings >> Directories.

Override the file in that directory

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

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Is There a Place to Store a Custom Version of civicrm/CRM/Profile/Page/View.
May 24, 2009, 03:54:28 am
(making lobo's instructions a bit more explicit here)

1. Create a new directory, /path/to/civicrm/custom_php

2. Duplicate the CiviCRM code tree for your file, eg /path/to/civicrm/custom_php/CRM/Profile/Page

3. Set the Administer CiviCRM > Global Settings > Directories > Custom PHP Path to "/path/to/civicrm/custom_php"

4. Copy the original CiviCRM file to /path/to/civicrm/custom_php/CRM/Profile/Page/View.php

5. Edit the copied View.php to your liking

This way, when you upgrade the core CiviCRM files, your code changes will not be overwritten.
@xurizaemon ● www.fuzion.co.nz

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Is There a Place to Store a Custom Version of civicrm/CRM/Profile/Page/View.php?

This forum was archived on 2017-11-26.