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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:12:42+00:00 2026-06-11T06:12:42+00:00

I am developing my own template selector for CSS templates. At the moment, it

  • 0

I am developing my own template selector for CSS templates. At the moment, it works fine, clicking on a name from the selectbox changes the template. However there is 1 function that is missing.

If you look here: http://www.demo.joomforest.com/?template=corporate

you can obviously see the URL contains ?template=corporate at the end of it, thus if you enter that URL, it loads the corporate template.

This is my selector so far: http://joomjunk.co.uk/demo

As you can see, I added a hash + template name to the end of the url upon selecting a template, however if you copy and paste that URL into a new tab for example, it loads the default template.

So my question is, how can I add something similar to ?template=corporate and have it load the correct template upon loading that specific URL?

I’m not asking for the full code, but to point me in the right direction.

Thanks in advance.

  • 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-11T06:12:44+00:00Added an answer on June 11, 2026 at 6:12 am
    window.location.search
    

    This will contain whatever comes after the ? in your URL, including the ?

    if

    window.location.href === "http://www.demo.joomforest.com/?template=corporate"
    

    then

    window.location.search === "?template=corporate"
    

    if you want to parse the query string, there are many resources available. If, however, you just want to do it for this specific case:

    var tmpl = window.location.search.split('=')[1];
    // tmpl === "corporate"
    

    This will split the string on = and then return the second element in the array

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

Sidebar

Related Questions

I am developing my own lightbox kind of jquery plugin. Everything works but I
I'm developing a facebook app with rails that uses external apis from my own
Now i am developing my own driver.I develop in i/o kitDriver template.I build my
I am developing my own forums and everything is working perfectly apart from when
I'm developing own CMS and i want to implement functionality to dynamically include existing
When developing my own Java class to use within ColdFusion 8 I stumble upon
I'm just developing my own mini framework for an application I was working on,
I'm developing my own FTP Client in C#, and - what's curious - sometimes
I'm developing my own OS, but for this I need to touch on linking,
I have just started with wordpress and want to start developing my own themes.

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.