Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • m Friend
    #163643

    Hi there,

    I have multiple templates installed on a site. I would like to be able to switch between these templates from the frontend of the website. This is fairly easy to do, there is a joomla module out there that does it. The problem is, clicking on a link will always revert the site back to the default template.

    For example, you can append the following to the URL to load a different template:

    ?template=template_name

    but when you click on a link, you lose that URL appendix. What can I do to keep the template switched? I imagine it would be adding something to the templateDetails.xml and then some php code to the index.php file. However, the T3 framework makes this kind of modification confusing!

    Suggestions?

    Thanh Nguyen Viet Friend
    #390100

    You must create cookie to store a template that user selected.
    The code snippet to do that can be placed on the module that you installed to switching between templates.

    Note: the cookie should be exactly named as “template_name”

    m Friend
    #390112

    What about appending a ” ?template=XYZ ” argument to every menu URL? Could this be done with some PHP in the template’s index.php file? Question is, using the T3 template, the only thing a template’s index.php file does is redirect to the JAT3 plugin. Also, the actual template XYZ name could be hard coded or take a value from the templateDetails.xml file.

    The nicest solution would be to build this function into the cpanel.php feature… but as a quick fix, it should be fairly easy to tell a template to append it’s name to the end of every menu URL.

    Suggestions on the best way to do this?

    Thanh Nguyen Viet Friend
    #390367

    Please try to add the below code snippet into “template switcher” module.

    [PHP]if(isset($_GET[‘template’])) {
    JRequest::setVar(‘template’, $_GET[‘template’], ‘COOKIE’);
    }[/PHP]

    <blockquote>What about appending a ” ?template=XYZ ” argument to every menu URL? </blockquote>
    It is only needed when you switch to new template, you don’t need to add it to each url

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 2 voices, and was last updated by  Thanh Nguyen Viet 9 years, 5 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum