Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7710947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:15:08+00:00 2026-06-01T01:15:08+00:00

I’m building a Drupal site, which has 4 different themes with different theme templates.

  • 0

I’m building a Drupal site, which has 4 different themes with different theme templates.

I need to use the same Drupal database to control all the content for all 4 themes.

I setup taxonomy for each theme, so when I create content I can apply it to one of the four different themes.

The Urls need to look something like

mysite.com/theme1/node/21

And

mysite.com/theme2/node/2

Also I need to make sure

mysite.com/theme1 needs to bring up the page-front.tpl.php for that theme based on the URL

I’ve tried using themekey which works ok except I don’t then know how to pull only content which has the applied taxonomy term for that site.

and I can’t get it to work with something like this

mysite.com/theme2/node/1

Only for

mysite.com/node/1/theme2

Any ideas, or anything you can provide to point me in the right direction would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:15:10+00:00Added an answer on June 1, 2026 at 1:15 am

    There are probably a ton of ways to do this but this is how I would do it.

    • Create a view display with an argument that filters by taxnonomy term translated from name to tid. This view will work as the front page.
    • Also create a view display that takes two arguments, checking if the second argument is a node tagged with the first arguments taxonomy term name. If it’s not return not found.
    • Note, we will only access these views in code so it doesnt matter if they are pages or blocks. Make sure not to name them the same as the themes if they are pages though, then they will override our menu entries.

    You could also query stuff just like in node.module but personally I prefer using views for doing the filtering.

    There might be typos and whatnot in this snippet but nothing I can see now.

    A good resource: http://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_menu/7

    /**
     * Implements hook_menu().
     *
     * Here we define the new frontpages as well as a node view page for all them custom themes.
     */
    function example_menu() {
      $items = array();
      foreach (example_custom_themes() as $theme) {
        // Define the front page
        $items[$theme] = array(
          'page callback' => 'views_embed_view',
          'page arguments' => array('VIEW', 'DISPLAY', $theme), // The front page view
          'access arguments' => array('access content'),
          'type' => MENU_CALLBACK,
          'theme callback' => 'example_theme_callback',
          'theme arguments' => array($theme),
        );
        // Define the node views
        $items[$theme . '/node/%node'] = array(
          'title callback' => 'node_page_title', 
          'title arguments' => array(1),
          'page callback' => 'views_embed_view',
          'page arguments' => array('VIEW', 'DISPLAY', $theme, 1), // The node view display
          'access callback' => 'node_access', 
          'access arguments' => array('view', 1),
          'theme callback' => 'example_theme_callback',
          'theme arguments' => array($theme),
        );
      }
      return $items;
    }
    
    /**
     * Returns an array of the machine named custom themes.
     */
    function example_custom_themes() {
      return array('theme1', 'theme2');
    }
    
    /**
     * Does nothing but return the theme name
     */
    function example_theme_callback($theme) {
      return $theme;
    }
    
    /**
     * Check if the url matches the front page of a theme. If so, suggest front template.
     */
    function example_preprocess_page(&$variables) {
      if (in_array(arg(0), example_custom_themes()) && is_null(arg(1))) {
        $variables['theme_hook_suggestions'] = 'page__front';
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.