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) »
  • Putting a profile within a new drupal page, themeing the profile
Pages: [1] 2

Author Topic: Putting a profile within a new drupal page, themeing the profile  (Read 9130 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Putting a profile within a new drupal page, themeing the profile
August 21, 2008, 11:25:18 am
Hi, thanks for reading.  So far so good, I've got myself a nice looking profile here.
http://rivernetwork.org/rn/index.php?q=civicrm/profile&gid=2&force=1


I want to put this profile within a Drupal page, give it a nice, pretty URL, and put it in the navigation at our site.  I go the the 'create content' feature of drupal, add a page.
www.mydrupalsite.com/node/add/page

Now how would I go about putting this profile in a specific page, theming it, or putting it in the menu system of our site?

Thanks!

Try CiviTeacher: the online video tutorial CiviCRM learning library.

geilhufe

  • I post frequently
  • ***
  • Posts: 293
  • Karma: 33
    • Social Source Software
Re: Putting a profile within a new drupal page, themeing the profile
August 21, 2008, 12:57:42 pm

(1) In Drupal, admin>>site building>>menus>>select menu>>new item
Past the full civicrm URL for the path.

(2) Pretty-fying the URL is one more step.
In Drupal, admin>>site building>>URL aliases>>add alias
Then instead of the CiviCRM URL, put the pretty drupal URL in step 1

Theming the CiviCRM profile is a whole nother ball game.
http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+and+Profile+Screens

You can't really put that interface "into" a drupal page... not sure what the use case for that would be.
Drupal and CiviCRM consulting, strategy and configuration
http://www.social-source.com/

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Putting a profile within a new drupal page, themeing the profile
August 22, 2008, 01:46:32 pm
I'm sorry either this doesn't work or I have misunderstood your directions.  Attempts to access the profile page through a Drupal alias result in "page not found".  See the attached screenshots.

Help?
Try CiviTeacher: the online video tutorial CiviCRM learning library.

geilhufe

  • I post frequently
  • ***
  • Posts: 293
  • Karma: 33
    • Social Source Software
Re: Putting a profile within a new drupal page, themeing the profile
August 22, 2008, 03:54:10 pm


Take a look at that existing system path... usually there is a "/civicrm/" in there, but verify the path is an exact match for what is displayed in your browser.

http://rivernetwork.org/rn/civicrm/profile&gid=2&force=1
resolves, so if you change the system path, the alias should work.

This works in Drupal 6.x Civicrm 2.x
Drupal and CiviCRM consulting, strategy and configuration
http://www.social-source.com/

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Profile within a new drupal page, themeing the profile, URL aliases don't work?
August 24, 2008, 09:18:20 pm
Thank you for your attention to this matter.  However, my efforts continue to fail.  Taking your advice, I changed the 'existing system path' as you instructed.  The URL alias fails to work again, now rather than a 'not found' instead taking me to the CiviCRM homepage.

It's true this URL works:
http://rivernetwork.org/rn/civicrm/profile&gid=2&force=1

But when put in an alias (see attached image) it does not work.

Also, since when does Drupal 6.x work with CiviCRM 2.x (inferring you mean also 2.0.x as well as 2.1 Alpha X)?  According to everything I have heard as well as this page http://drupal.org/project/civicrm  CiviCRM 2.1 will work with Drupal 6.   I am currently running Drupal 5.9 and CiviCRM 2.0.5 on two completely different sites (different servers entirely) and I can confirm that URL aliases + CiviCRM profile = not work on either.

THE BIG PICTURE here is that my company wants to use CiviCRM profiles to make public member directories, and have these directories appear as content items in the leftnav of the Drupal site and behave similarly to Drupal pages.  I am confused that whenever I view these CiviCRM profiles I cannot get rid of the CiviCRM menu in the leftnav and I cannot use URL aliases either.  How can I accomplish my goal of more seamlessly inegrating CiviCRM profile pages into Drupal?




Please help!

« Last Edit: August 24, 2008, 09:29:21 pm by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

dharmatech

  • I post frequently
  • ***
  • Posts: 280
  • Karma: 53
    • dharmatech.org
Re: Putting a profile within a new drupal page, themeing the profile
August 25, 2008, 07:15:51 am
I think what you are needing is Drupal's path redirect module. Found here http://drupal.org/project/path_redirect

Basically, you can accomplish what you need by making a "pretty" URL like mysite.org/donate redirect to civicrm/contribute/...etc.

The good thing with this module is that the "alias" you create, in the example above (donate), does not need to be an existing drupal path for a node.

hope this helps
http://dharmatech.org
oss@dharmatech.org
801.541.8671

geilhufe

  • I post frequently
  • ***
  • Posts: 293
  • Karma: 33
    • Social Source Software
Re: Putting a profile within a new drupal page, themeing the profile
August 25, 2008, 09:45:55 am
First, I suspect you are going to need to invest some time learning about some of the basics... redirects, how Drupal menus work, etc. I know it can be frustrating, but it is also quite rewarding once you get to the epiphany stage.

(1) Since you are running Drupal 5.9, path aliases will not work (drupal has trouble handling the parameters -- & -- in a CiviCRM path). This is fixed in Drupal 6.x

(2) I am being imprecise with my version numbers. I should have wrote this will work with Drupal 6.x and CiviCRM 2.1+.

(3) You can achieve your goal by upgrading to Drupal 6.x, CiviCRM 2.1+ or using alternate strategies.

(3a) Strategy 1: The path redirect module will probably work and might be easier to manage than option 2. I have not tested this approach.

(3b) Strategy 2: My personal favorite, a Javascript redirect. Here are some detailed instructions:

(i) Create a new Drupal page.
(ii) Set the menu entry to whatever you want.
(iii) Create a piece of Javascript to handle your redirect.
Quote
<script type="text/javascript">
<!--
window.location = "http://www.google.com/"
//-->
</script>
(replace google.com with your
(iv) Make sure you save this page with the Full PHP input filter (if you save with the html input filter, the javascript will not work)
(v) Now whenever you navigate to the drupal page ( /node/###) you will end up on the civicrm page specified in the javascript redirect.

Drupal and CiviCRM consulting, strategy and configuration
http://www.social-source.com/

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Putting a profile within a new drupal page, themeing the profile
August 25, 2008, 12:16:31 pm
@dharmatech  Thanks for the recommendation for path_redirect.  Unfortunately I installed the module, activated it, and it doesn't work.  It's a no show in the menus.  I spend almost an hour reviewing the non-existent docs for this module as well as the string of support issues for the module.   Chalk it up to ??? but it doesn't work.

@geilhufe  Thanks for your recommendation.  I ended up using the Javascript redirect, which I find bizarre that the solution for a simple problem with such powerful software would be ... Javascript.

As for getting accustomed to the menu and redirects, menuing 'basics' I know you meant no offense, but I am slightly miffed that you would make the assumption that I don't know the basics.  In fact we've created a menu system of hundreds of pages and hundreds of URL redirects.  I'm not a 'guru' but I do have a good working knowledge of Drupal menus.  The problem here is the software - the fact that URL aliases in Drupal 5.x and CiviCRM 2.0.x don't work together.

As for upgrading to 2.1 (currently in Alpha stages) I am not going to upgrade a production site to an alpha version of any software, it's bad practice.

As for the theming, I am still confused about how to get a Profile page in CiviCRM to have the same menu format as the Drupal pages... in other words ... to integrate a CiviCRM Profile into Drupal next to Drupal pages and have the integration be seamless - as a navigation item that maintains navigation state as you view the Profile.

@Anyone Any ideas about seamless CiviCRM profile integration into Drupal alongside Drupal pages please chip in.
 
Try CiviTeacher: the online video tutorial CiviCRM learning library.

dharmatech

  • I post frequently
  • ***
  • Posts: 280
  • Karma: 53
    • dharmatech.org
Re: Putting a profile within a new drupal page, themeing the profile
August 25, 2008, 01:09:24 pm
Hi Stoob. We use path redirect all the time and it works fine. You can play with it on our demo site: demo.dharmatech.org
user/pass is demo
and go here to configure and create redirects: http://demo.dharmatech.org/admin/build/path_redirect

Here's an example: http://demo.dharmatech.org/donate
redirects to: http://demo.dharmatech.org/civicrm/contribute/transact?reset=1&id=1

As far as integration with profile pages, have you tried embedding civicrm profiles in a drupal page (node)? Here's an example: http://demo.dharmatech.org/programs

Then you can use drupal's menus and blocks and navigation just like you normally would.  Not sure if this helps.

tony
http://dharmatech.org
oss@dharmatech.org
801.541.8671

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Putting a profile within a new drupal page, themeing the profile
August 25, 2008, 01:37:54 pm
Thank you for the login to your demo site.

You're right.   I logged in.  I get it.   Your site works great!

Mine doesn't!

It's actually not because I don't understand what a URL redirect is or how to create one....it's because I installed and enabled the module and it's non-functional.  I'm actually pretty diligent and resourceful when it comes to exploring my options and I've got 10 years experience as a programmer.   By 'non-functional' I mean the module doesn't even show up in my Admin > Site Building menu.  I tried to make this clear but I guess I failed.  So just so you believe me, I'm going to include some screenshots.   :)

As for embedding the Profile in a page, that would be great, however I am using the profile as a Search Result, not as an add/edit form, and unless I am mistaken, you can only embed a Form by using "Code for Stand-alone HTML Form" and cannot embed a search result.  If I am incorrect and you CAN imbed a search result like mine:  http://rivernetwork.org/rn/civicrm/profile&gid=2&force=1  (check it out!) please tell me how! 

Thanks!



Try CiviTeacher: the online video tutorial CiviCRM learning library.

dharmatech

  • I post frequently
  • ***
  • Posts: 280
  • Karma: 53
    • dharmatech.org
Re: Putting a profile within a new drupal page, themeing the profile
August 25, 2008, 02:10:13 pm
I see. I jumped in late to this thread. My apologies. You are correct that you cannot embed search results profiles. Let me think about this a bit more to figure out a good solution or workaround.

I hate to ask another obvious question but did you give yourself permission to administer the path redirect module once you enabled it? that's the only thing i can think of that makes it not work. Several of our clients use it and it works fine.

hope this helps
t
http://dharmatech.org
oss@dharmatech.org
801.541.8671

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Putting a profile within a new drupal page, themeing the profile
August 25, 2008, 02:52:56 pm
Doh!  That's it!  Now it's my turn to apologize.  Permissions...permissions...permissions.   Now I can use it now that I've given myself permission to use it... wow.

Ok but still the "embed the profile within a page" issue remains.  I would appreciate any thoughts you have.  As you can see we have a directory of over 600 contacts and I'd like to have the drupal navigation remain consistent on that profile when viewing it.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

dharmatech

  • I post frequently
  • ***
  • Posts: 280
  • Karma: 53
    • dharmatech.org
Re: Putting a profile within a new drupal page, themeing the profile
August 25, 2008, 03:09:21 pm
This is not ideal but here is one option:

Go to administer>>site building>>blocks and configure the menu block that you want to appear on the profile page to only appear on the path: civicrm/profile*

You can't put the full URL because with Drupal's clean URL's it doesn't work but, as i think Geilhufe mentioned, will be fixed in Drupal 6. So you need to put the "clean part" (civicrm/profile) and put a wildcard (*).  The problem with doing this is that that menu block will appear on every CiviCRM profile since every profile will have that first part in the path.  But if this is the only profile on your site, this should work fine.

Does this make sense?

i did this on our demo site: http://demo.dharmatech.org/civicrm/profile?force=1&gid=2 I made the "about" menu appear on the profile "advisory board members." Navigate to about>>adv. board members to see what i mean. (will look better logged out).

tony
« Last Edit: August 25, 2008, 03:12:04 pm by dharmatech »
http://dharmatech.org
oss@dharmatech.org
801.541.8671

geilhufe

  • I post frequently
  • ***
  • Posts: 293
  • Karma: 33
    • Social Source Software
Re: Putting a profile within a new drupal page, themeing the profile
August 25, 2008, 05:33:34 pm
stoob- no offense meant... generally people figure out that volunteers like me on forums are trying to lend them a hand.

Since the profile formatting question is still open, is it correct for me to assume that
(1) You've reviewed the doc links (http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+and+Profile+Screens) and understand the differences between how Drupal builds a page and CiviCRM builds a page? And understand how the tpls provided by each system get combined into a single html page delivered to the user?
(2) You've identified the tpl file that drives the search results display (following the instructions in the doc for that page on rivernetworks, that would be
Quote
<!-- .tpl file invoked: CRM/Profile/Page/Listings.tpl. Call via form.tpl if we have a form in the page. -->
(3) You've created a new .tpl for the Listings.tpl or form.tpl if that is your concern, set up the overrides and that did not deliver the formatting control you were looking for?

The tpl mod only controls the CiviCRM part of the page.

For the drupal part of the page, drupal navigation is sometimes provided by blocks as darmatech mentioned.... often times blocks are configured to be displayed or hidden on civicrm/* paths... this can make the default navigation a bit funky since civicrm/profile is a public facing page and civicrm/admin is an admin facing page. You can modify those paths to accomplish a variety of goals.

And finally, more precise detail on what you are trying to accomplish with links and descriptions to what you have tried already will allow folks to get you on the right path.

Drupal and CiviCRM consulting, strategy and configuration
http://www.social-source.com/

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Putting a profile within a new drupal page, themeing the profile
August 26, 2008, 11:56:37 am
Guys thanks both of you (++karma).  I have found a solution to most of my issues with the use of your civicrm/profile* solution as well as create use of themes and blocks.   This gives me the menu I want with the theme that I want for the Profile.

I am still wondering if there is any way I can hack the menu to have the 2nd level remain open, as if to recognize that the profile belongs in the 2nd level of the menu.  I will look into this later.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Putting a profile within a new drupal page, themeing the profile

This forum was archived on 2017-11-26.