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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom Page / Understanding the Architecture
Pages: [1]

Author Topic: Custom Page / Understanding the Architecture  (Read 1544 times)

independentexile

  • Guest
Custom Page / Understanding the Architecture
May 21, 2009, 12:49:21 pm
Hello All,

I'm currently doing some work with CiviCRM's group system.  Since you can assign groups to a parent, there's a nice hierarchy system built in.  I'm trying to make use of this for my particular application of the software.  Basically, when I set up the groups, no group will have more than one parent, resulting in a sort of tree structure.

My goal to is create a page that displays this structure, preferably within CiviCRM.  Once this basic step is done, I would like to continue to develop the page to allow for modifying the group structure through the visual tree representation.

After reading a fair bit of documentation (esp at civicrm.org/architecture), I am still not completely clear on the software's architecture.  As I understand it, there is a PHP class behind every page, and a template to match it.  The PHP class is added to the XML Menu file in the related component's directory to make the connection between the URL and the PHP handler. 

In experimenting, I created a basic PHP class which extends the CRM_Core_Page class.  I made a template in the matching location in the template directory and gave it the same name.  Finally, I added a reference to the PHP page in the XML file in CRM/Core/xml/Menu/ directory .  When I attempt to visit this page, I simply see the CiviCRM dashboard, and not the page I put together.  There are no errors or other feedback.

Is my understanding of the structure correct?  Am I on the right track?  I feel like I'm missing something, but I've had a hard time finding documentation that explains the system beyond this point.  Or, maybe I'm oversimplifying things.

I realize that I might be able to accomplish the above task through templates alone, but I feel I'd have more flexibility if I could roll up my sleeves and dig into the structure of CiviCRM a little more :)

TIA,
Josh
« Last Edit: May 21, 2009, 01:00:30 pm by independentexile »

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: Custom Page / Understanding the Architecture
May 21, 2009, 02:46:15 pm

hey josh:

1. in future might be easier / faster to ping us and ask questions on IRC :) http://tinyurl.com/civiirc

2. You are on the right track. The only missing piece is to rebuild the menu. On drupal q=civicrm/menu/rebuild&reset=1

this basically takes the xml files and populates a DB table (civicrm_menu) which is then used when we hit a civiurl to find the right page/form to execute

kinda impressed as to how nicely you reverse engineered the system :)

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

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: Custom Page / Understanding the Architecture
May 22, 2009, 03:55:05 am
josh - you want to impress us further when you are done and share a screenshot?
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

independentexile

  • Guest
Re: Custom Page / Understanding the Architecture
May 22, 2009, 07:15:11 pm
Wow - that worked perfectly.  Thanks much!

With that little roadblock out of the way, I'll be well on my way to getting that screen shot for you ;D

BTW, so others don't have to struggle with the same problem, is there is a good place in the wiki to place this little tidbit?  They only page I can find it on is at: http://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location , which would explain why I missed it.  I might suggest adding it to this page, which describes the XML files (I found it to be very helpful)

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: Custom Page / Understanding the Architecture
May 23, 2009, 08:01:31 am

modified and added the information. Note that the wiki is editable, so feel free to edit and improve the wiki pages in future

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

independentexile

  • Guest
Re: Custom Page / Understanding the Architecture
May 28, 2009, 10:33:18 am
Okay, thanks for making the edit :)

As promised, here are some screen shots of the development thus far:

The tree view: http://home.earthlink.net/~masterofthekeys/postimg/civicrm_tree.jpg

The following is the page that appears when the "add child" link is clicked.  Basically, the appropriate group in the "Add Parent" drop down list is automatically selected: http://home.earthlink.net/~masterofthekeys/postimg/civicrm_group_creation.jpg

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: Custom Page / Understanding the Architecture
May 28, 2009, 12:17:02 pm
That looks seriously useful - great work.
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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom Page / Understanding the Architecture

This forum was archived on 2017-11-26.