I want to assign to a page I created the same theme that is set for my admin pages. Preferably so that if I switch the admin theme, the page's theme also changes. How can I do that?

Comments

prizkall’s picture

Can anybody at least point me in the right direction to solve this? Much appreciated...

francort’s picture

Maybe you can use taxonomy theme
Give your page a taxonomy and give it whatever theme you like.
It won't fix your problem about switch theme, but maybe it would help.

prizkall’s picture

Thanks for the pointer, but it doesn't help me since I'm running Drupal 6.3. Anywhere in the API that I could look to assign a theme to a page?

francort’s picture

I'm sorry that i haven't see the fact that you're working on Drupal 6 and the module i've mentioned isn't available yet.
There are people developing it, but in the meantime, just for your case, you can add this very very custom module that i've made as an apology :)

module page_theme( this is the name of the folder that contains this module )

page_theme.info

; $Id: Exp $
name = Page Theme
description = Enables different theme for one page.
core = 6.x
package = can not be more optional

page_theme.module

function page_theme_theme() {
  return array(
    'page_theme_' => array(
      'arguments' => array('form' => NULL),
    )
  );
}

function page_theme_init() {
  $mynode_url = "node/1"; //you should change this for the particular node that you want to change it's theme
  global $custom_theme;

  $result = db_query("SELECT value FROM {variable} WHERE name = 'admin_theme'");
  $row = db_fetch_object($result);
  $themes = explode( ":", $row->value );
  $theme = str_replace('"', '', $themes[2] );
  $theme = str_replace(';', '', $theme );

  if( $theme && is_integer( strpos( $_GET['q'], $mynode_url ) ) &&  $theme != 'default' ){
  	$custom_theme = $theme;
    init_theme();
  }
}

function page_theme_nodeapi( &$node, $op, $teaser, $page ){
	if( $op == 'alter' ){
		page_theme_init();
	}
}

Just change the line with the url.
This isn't fancy at all, but it is gonna do the job while the real module to do this task is under developement.

I hope it will solve for a while your problem