1

I have a custom content type property. The registered user can create the property when logged in. I want to theme the "create property page" the same as the site's default theme. Please let me know how we can theme the "create propery page". Is there any module or do we need to do something else?

3
3

Sometimes I want certain roles to see the admin theme on a given page, and sometimes I don't. whitefleaCH's ThemeKey suggestion might address that better (haven't tried that module) but another module suggestion that addresses this is Page Theme. Extremely simple module that does exactly what it's name implies:

  1. Install the module
  2. Go to /admin/structure/page-theme and click "Add theme"
  3. Pick your installed theme and add "node/add/property" and "node/edit/property" and any number of other relative paths to the "Pages" field.

Anyone visiting any of those paths will see the content through the theme you designated.

1

The link is in the other Question: here it is for you again: Drupal 7 Theme Hook Suggestions

And this module will help also: devel_themer

You also can set the admin theme to the same theme as the website. Under /admin/appearance

1

I guess you have admin_theme installed and you want the node/add/property page to look like the frontend theme NOT the admin theme is that right? If it is then you need to make a very simple small custom module, and if you're using Drupal 7 implement hook_menu_alter() and a custom callback (Of course replace hook with your module name):

/**
 * Implements hook_menu_alter.
 */
function hook_menu_alter(&$items) {
  $items['node/add/property']['theme callback'] = 'hook_custom_get_default_theme';
}

function hook_custom_get_default_theme() {
  return variable_get('theme_default', '0');
}

(Source)

For Drupal 6 implement hook_init()

/**
 * Implementation of hook_init().
 */
function hook_init() {
  global $custom_theme;

  // Set default theme for specific node types when use administration theme for node editing is set
  if (variable_get('node_admin_theme', 0)) {
    $node_types = array( // The node types you want to use default theme for
      'property',
    );

    if (arg(0) == 'node' && arg(1) == 'add') {
      $current_type = arg(2);
    }
    else if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'edit') {
      $node_to_check = node_load(arg(1));
      $current_type = $node_to_check->type;
    }

    if($current_type && in_array($current_type, $node_types)) {
      $custom_theme = variable_get('theme_default', '0');
      init_theme();
    }
  }
}

(Source)

If that's not the case, you seriously need to rephrase your question, cause it doesn't make any sense otherwise.

1

ThemeKey allows you to define simple or sophisticated theme-switching rules which allow automatic selection of a theme depending on current path, taxonomy terms, language, node-type, and many, many other properties.

Also take a look at a Tutorial.

1

If you are facing issue that the node add form is picking up the admin theme instead of site default theme, the reason might be setting of permission of allowing registered user to see the admin theme, check the screen shot below

enter image description here

So If we do not allow registered users to see the admin theme, the node add form will take the site default theme itself.

While in case the above solution seems off beat to your issue, solution proposed by Beebee must work, I have used that before in different scenario when I was supposed to open a particular node add form in site default theme for administrator itself.

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.