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 3595994
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:55:33+00:00 2026-05-18T19:55:33+00:00

Anybody ever tried to change joomla 1.5 template in code? Don’t know how to

  • 0

Anybody ever tried to change joomla 1.5 template in code? Don’t know how to do it on current version. I just wanted to change the template after the user login.

So, i wrote code like this :

$mainframe->setTemplate('newtemplate');

But it doesn’t works. WHen i see the joomla application.php, whoops, there is no setTemplate function there, but it used to be there before 1.5 (based on my search on the web).
Anyone know how to do it?

Update :
seems that we can set user state and just read that user state, then render. But I don’t know where joomla render the template, since I put a code in library/joomla/application.php, insite render(), but it didn’t get executed. This is what i did :

function render()
{
    $params = array(
        'template'     => $this->getTemplate(),
        'file'        => 'index.php',
        'directory'    => JPATH_THEMES
    );

    // I added this code, where i set the user state $option.template somewhere else
    $template = $mainframe->getUserState( "$option.template", 'FoxySales01VIP' );
    if(!empty($template)){
        $params['template'] = $template;
    }

    $document =& JFactory::getDocument();
    $data = $document->render($this->getCfg('caching'), $params );
    JResponse::setBody($data);
}
  • 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-05-18T19:55:34+00:00Added an answer on May 18, 2026 at 7:55 pm

    Never mind, i solved it.

    Just change the code in core library (JDocument Class) to read the template from session, works fine.

    Thanks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have anybody ever tried to create thumbnails/previews of MS Office files? I do not
Anybody ever had the error Installation of the Microsoft Expression Web 2 product has
Anybody know of a way to copy a file from path A to path
Anybody know what my DLLImport statement should look like here: extern C __declspec(dllexport) long
Anybody know how to get gmail's OpenID working? All I find is this http://openid-provider.appspot.com/
Anybody in the know of a viewer (or Notepad++ plugin) that can read txt
Does anybody know how to click on a link in the WebBrowser control in
Anybody have a good example how to deep clone a WPF object, preserving databindings?
Anybody found yet a good web site architecture using linq to sql? Any help
Anybody knows how to do this? I got all the information of the email

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.