Theming with Profile2

User-profile.tpl.php

If you are designing a custom template for your user profile pages and are using the Profile2 module, you probably are looking to add your custom fields to the user-profile.tpl.php template. Here is how this can be accomplished.

This assumes that you have a Profile2 profile type called my-profile. You may easily load your fields into your custom user-profile.tpl.php by printing them like this:

Pass the theme path to javascript

Description

This extends Drupal.settings allowing you to get the theme path in a javascript file

Steps

Add a preprocess function to your theme's template.php

Using drupal_add_js we extend Drupal.settings in order to make it a variable that returns the path to the theme

p.s. don't copy the php tags into template.php just what's inside.

Pass the theme path to javascript

Description

This extends Drupal.settings allowing you to get the theme path in a javascript file

Steps

Add a preprocess function to your theme's template.php
Using drupal_add_js we extend Drupal.settings in order to make it a variable that returns the path to the theme

p.s. don't copy the php tags into template.php just what's inside.

Subscribe with RSS Subscribe to RSS - template