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) »
  • Problem customizing templates
Pages: [1]

Author Topic: Problem customizing templates  (Read 2491 times)

May0rDav3

  • Guest
Problem customizing templates
October 10, 2010, 07:41:58 am
Hello, please forgive my ignorance as I am new to the whole CiviCRM module (Ubuntu and drupal too for that matter).  I started about a week ago and am using the newest stable version of both drupal and CiviCRM. (all running on localhost)

I have come to a bit of a stumble in my quest though. I have followed the steps on the wiki to create my custom template folder, copy the core templates to the same directory structure within my custom directory.  I have added the custom template directory in full path to the 'Directories' section and tried to edit one just to test it out.  I do not have a templates_c folder in my civicrm root, so I enabled debugging and used the &directoryClean=3 to attempt to clear the compiled templates. 

The problem I have is that I edit the EventInfo.tpl file in my custom directory, and no changes are seen when you view the event via http.  I confirmed that my directories were set, spelled correctly, and I even tried to rip out the whole chunk of the .tpl which outputs the priceset values/labels - but no change.  But if I change the core template -it works fine.  The core template is in my civicrm root directory under templates/CRM/Event/Page/EventInfo.tpl


cvcrm points to /var/www/cvcrm_custom for my custom templates
EventInfo is said to be located CRM/Event/Page/EventInfo.tpl
so my custom EventInfo is located at /var/www/cvcrm_custom/CRM/Event/Page/EventInfo.tpl

Thank you for any suggestions you may be able to offer.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Problem customizing templates
October 10, 2010, 08:55:54 am
In your custom directory, you don't need to copy all the core templates--you only need to put there those templates you customize.

Anyhow, what you write looks good. This could be a permissions problem. Does Apache have read access to /var/www/cvcrm_custom ? May need execute access as well--I don't recall.
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.

May0rDav3

  • Guest
Re: Problem customizing templates
October 10, 2010, 03:43:38 pm
Sorry, I may not have been very clear with the templates but I did copy over two templates to which I am modifying for this purpose.  The first is EventInfo, the second is Registration (but I have to solve my problem before getting there).

I chmod'd the directories/files so everyone would have read/write/execute priv. but that did not resolve it.  I tried a reboot of my machine also - just in case, but alas, I edit the EventInfo.tpl file in the core templates and it works great!, but I edit the file in my custom directory, and nothing happens.  I know for the purpose of learning, I can edit the ones in the templates folder of civicrm, but I would still like to resolve my issue so when I go live with this, I don't have any major issues when I upgrade in the future.

If anyone has any other suggestions, please shoot them my way. 

May0rDav3

  • Guest
Re: Problem customizing templates
October 10, 2010, 04:10:22 pm
In Addition, when I rename the main template to try to force it to look into the custom directory, it shoots me this error when I attempt to access the event:


    * user warning: Smarty error: unable to read resource: "CRM/Event/Page/EventInfo.tpl" in /var/www/sites/all/modules/civicrm/packages/Smarty/Smarty.class.php on line 1093.
    * user warning: Smarty error: unable to read resource: "CRM/Event/Page/EventInfo.tpl" in /var/www/sites/all/modules/civicrm/packages/Smarty/Smarty.class.php on line 1093.

Looking into the php file, all I see on line 1093 is the function to shoot the error.  A reference is made to the 'templates_c' directory (but I cannot find this directory), and the directoryClean=3 should have cleaned all three of the directories right?



Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Problem customizing templates
October 10, 2010, 11:05:31 pm
Perhaps try to put your custom templates under your Drupal root, if they are not there.

The templates_c directory needs to be in sites/default/files and Apache needs write access there. Check that also.
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.

May0rDav3

  • Guest
Re: Problem customizing templates
October 11, 2010, 11:07:01 pm
Thank you for the reply.  My custom template folder is in my drupal root (which I installed right into the /var/www/ as opposed to the default /var/www/drupalxxxx directory.  Perhaps this is my problem, maybe the drupal root shouldn't be in the site root itself.  I did this to load the drupal home automatically when I visit the domain (in this case: http://localhost/).  I did check the files directory and when I installed drupal, I granted write access to the folder (and contents), and never changed it back.  There has to be something I am missing, but perhaps I will use the core templates to edit - to get the functionality and documentation that I need.  Afterwards, I am going to re-install everything and try the custom template directory again.  If the problem persists when I go live, I will store backups of the .tpl files I edit so that way when I upgrade civicrm, I can just overwrite the files (last case scenario work-around of course).

Thank you for the suggestions non-the-less.  But considering that no one else seems to be experiencing this issue, I can pretty safely assume that it has something to do with my installation (so a fresh installation should resolve it).

Thanks again,

tomfloyd

  • Guest
Re: Problem customizing templates
November 15, 2010, 03:06:16 pm
mayordav3, if you still have the problem please reply. Had the same problem, now fixed - its just a directory path issue.
Tom

rennevat

  • Guest
Re: Problem customizing templates
November 22, 2010, 05:48:01 am
tomfloyd - I'm experiencing the same issue.  Can you post how you resolved your directory path issue?
Thank you.


Edited PCPinfo.tpl and saved to
civicrm_custom/CRM/Contribute/Page

Edited directories to reflect custom folder:
mysite/public_html/cms/civicrm_custom (chmod at 755)

Enabled debug
and cleaned template directory using &directoryCleanup=1at the end of the url of PCP page

Also ran Smarty debug and custom template directory is correctly defined.

(template changes work when installed over civicrm core templates, but prefer not to do this.)
« Last Edit: November 22, 2010, 05:49:51 am by rennevat »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Problem customizing templates
November 22, 2010, 05:50:44 am
Quote from: rennevat on November 22, 2010, 05:48:01 am
Edited directories to reflect custom folder:
mysite/public_html/cms/civicrm_custom (chmod at 755)

This should be a fully qualified path such as:

/home/mysite/public_html/cms/civicrm_custom

HTH
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.

rennevat

  • Guest
Re: Problem customizing templates
November 22, 2010, 12:09:51 pm
Thank you for responding.  Checked in admin and it is listed as  /home/mysite/public_html/cms/civicrm_custom.  Sorry, I failed to add /home when typing the reply.  Can you suggest any additional troubleshooting techniques that might help me identify the problem?  Thank you.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Problem customizing templates
November 22, 2010, 12:15:07 pm
Try

/home/mysite/public_html/cms/civicrm_custom/

with trailing slash
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.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Problem customizing templates

This forum was archived on 2017-11-26.