Solved

How to change dupal theme programmatically

Posted on 2008-10-19
5
820 Views
Last Modified: 2013-11-10
Hello,

I want to have different theme for mobiles and PCs in Drupal 6 CMS. I plan to do it like following: first _init hook is called from my custom module. This hook checks USER_AGENT and decides if it is a mobile device. Then it should pick a theme to be displayed. So a question, how to select a theme from within a module hook?

TIA
0
Comment
Question by:U4enik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 5

Expert Comment

by:stephencolson
ID: 22752415
You are essentially asking for something very similar to the Sections module: http://drupal.org/project/sections

Assuming that can't do exactly what you need, it should provide all of the techniques for you to gut it's functionality and implement it.
0
 

Author Comment

by:U4enik
ID: 24379948
sorry, but this wasn't helpful
0
 
LVL 5

Accepted Solution

by:
stephencolson earned 500 total points
ID: 24380649
Not sure why this wasn't helpful at all. I've done a similar thing using what I had described with good effect. If you wanted more information or some part wasn't clear, you should state that as we can't read your mind.

Please respond so we can get your problem solved.
0
 
LVL 1

Expert Comment

by:ussher
ID: 25265344
also looking for this functionality.  

I want to know how to do it PROGRAMMATICLY  not "just add xxx module."

seams silly to open another question to ask the same question.

here is how to programmaticly insert a view.
http://www.pixelclever.com/how-programmatically-insert-a-view-drupal-6

looking for other ways to also alter themes programmaticly
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question