0

i'm on drupal 7, using a premium theme "fundedvisual" and i'm trying to do some templates on a sub theme called "fundedvisual_subtheme".

I'm a noob in this, so maybe i did something wrong...

I have Profil2 module with 2 different profil types here the system names : "investor" and "project_creator".

i followed the answer of jeff_shamley in this post : Profile2 Template for edit page

i created a template.php file in "/sites/all/themes/fundedvisual_subtheme/" with this in it :

function fundedvisual_subtheme_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'user_profile_form') {
if ($form['#user_category'] === 'investor') {
  $form['#theme'] = 'profile2_investor_edit_form';
} else if ($form['#user_category'] === 'project_creator') {
  $form['#theme'] = 'profile2_project_creator_edit_form';
} else if ($form['#user_category'] === 'main') {
  $form['#theme'] = 'profile2_main_edit_form';
}
  }
}

function fundedvisual_subtheme_theme() {
  return array(
'profile2_investor_edit_form' => array(
  'arguments' => array(
    'form' => NULL,
  ),
  'template' => 'profile2-investor-edit',
  'render element' => 'form',
),
'profile2_project_creator_edit_form' => array(
  'arguments' => array(
    'form' => NULL,
  ),
  'template' => 'profile2-project_creator-edit',
  'render element' => 'form'
),
'profile2_main_edit_form' => array(
  'arguments' => array(
    'form' => NULL,
  ),
  'template' => 'profile2-main-edit',
  'render element' => 'form',
),
  );
}

Then i made 3 files in "/sites/all/themes/fundedvisual_subtheme/templates" :

profile2-investor-edit.tpl.php
profile2-project_creator-edit.tpl.php
profile2-main-edit.tpl.php

with this in it :

<?php echo "pouet" ?>

Then i cleared the cache a million time :'D

Annnnnnnd nothing show up except the default system profile :/

Did i forget something ? Thx in advance !

Edit : i wonder if i can just embed these forms pages in views it would be nice, instead of creating templates with that i could just modify my style.css

Edit2 : one of my comments : to be more precise i have a general page called "my account" and in it i have the header menu on the top, below an image with a title, below another menu bar and below the content of each "button" from that menu bar. Each time i click on a button from my menu i want to keep that template, so if i click on "profile" in my menu bar, it should be exactly the same except the title and the content. Is that possible ?

0

If the whole point of this is to be able to add wrappers around fields, an alternate option would be to use the field group module. Here is a video tutorial on it.

|improve this answer|||||
  • This is not what i search, to be more precise i have a general page called "my account" and in it i have the header menu on the top, below an image with a title, below another menu bar and below the content of each "button", each time i click on a button from my menu i want to keep that template, so if i click on "profile" in my menu bar, it should be exactly the same except the title and the content. Is that possible ? – Quentin Jun 7 '18 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.