Hi,

I am trying to enable frontpage through the installation profile. I have created 5 roles and I want to redirect the frontpage to a particular node to each role. I am not able to understand how I should pass this value in my installation profile.

The module has the following lines:

switch ($role) {
case 1: // Anonymous user
$default_value = variable_get('front_1_type', 'themed');
break;
case 2: // Authenticated user
$default_value = variable_get('front_2_type', 'themed');
$options['same_as_anon'] = t('same as anonymous users');
$description .= '

'. t('same as anonymous users') .'
'. t('will display the same content as for Anonymous users.') .'

';
break;
default: // Other roles
$default_value = variable_get('front_'. $role .'_type', 'themed');
$options['same_as_anon'] = t('same as anonymous users');
$options['sameasauth'] = t('same as authenticated users');
$description .= '

'. t('same as anonymous users') .'
'. t('will display the same content as for Anonymous users.') .'

';
$description .= '

'. t('same as authenticated users') .'
'. t('will display the same content as for Authenticated (logged in) users.') .'

';
break;
}

$form[$role]['front_'. $role .'_type'] = array(
'#type' => 'select',
'#title' => t('Select type'),
'#default_value' => $default_value,
'#options' => $options,
'#description' => '

'. $description .'

',
);

I want to make the default type as "redirect" through my profile and i tried doing this:

variable_set('front_1_type', 'redirect');
Similarly I have set values for each role.

Also inorder to redirect the page the module has the following code:
$form[$role]['front_'. $role .'_redirect'] = array(
'#type' => 'textfield',
'#title' => t('Redirect to'),
'#default_value' => variable_get('front_'. $role .'_redirect', 'node'),

Thus I have used:
variable_set('front_1_redirect', 'node1')

However none of these settings are working through my profile. Can anyone suggest what I am doing wrong and what I need to do to enable these settings in the profile?

Thanks in advance,

Divya D

Comments

dublin drupaller’s picture

Status: Active » Closed (fixed)

hi Divya, did you make any progress with this? Open back up if you are still stuck.