Jump to content
TNG Community

Template Switch mod question?


marcirish

Recommended Posts

How difficult would it be to adapt the Template Switch mod to allow a user to select the template they want to use overtime they log into my website?  I have three or four templates that would be available for use and I would like to offer them to my users; allow them to select that template; and save their choice so that the next time they logged in it would remember the template they selected.

Thanks.

 

Marc Irish

Link to comment
Share on other sites

Bill Herndon
On 8/6/2025 at 1:06 PM, marcirish said:

How difficult would it be to adapt the Template Switch mod to allow a user to select the template they want to use overtime they log into my website?

@marcirish Not too hard, I think.  Some years back I implemented a prototype for template switching, but then Ron Krzmarzick came out with the Template Switch mod and I shelved my prototype.  Three differences between my prototype from Ron's:

  • The functionality was menu item that took the user to a selection page.  (I think I might also have implemented a code-snippet for a button to be placed anywhere the site owner wanted)
  • The mod supported all templates, named and numbered.

Again...not looking at the code, but I think that the chosen template ID was stored in a cookie.  So the user would see the same template until they made a switch, the cookie expired, the user switched browsers, or cleared their browser cache.  The functionality was available at all times...not just when a user was logged in to TNG, though.

Unfortunately, I don't have time to dig out the code and get it updated in the short term.  I'm going to be on vacation for a while...away from my computer and code repository.

Do you need something soon?

- Bill Herndon

Lindell-Herndon Genealogy

Link to comment
Share on other sites

  • 1 month later...
39 minutes ago, marcirish said:

Bill--

Just looping around to see if you anted to pursue this idea?\

Marc

Hey Marc... Let me take a look at my old code, and see how much work it might be.

k/r

Bill Herndon

Link to comment
Share on other sites

  • 1 month later...
On 9/18/2025 at 7:14 AM, Bill Herndon said:

Hey Marc... Let me take a look at my old code, and see how much work it might be.

k/r

Bill Herndon

Hey Bill,

Have you had a chance to take a look at your code to see how difficult it would be to create a mod that would allow a user to select the template that appeals to them from a selection that I would select/populate/make available.

 

Marc

Link to comment
Share on other sites

Marc... Sorry for the delay.  I was never able to locate the code of the original solution.  It's possible I never committed it to my source-code repository.  Since then I've been dealing with some medical issues and totally forgot about the mod, but I'm on the mend now and will see if I can recreate it.  One thing:  For the mod to work--at least without frustration for site users--it'll need a list of templates that have been populated with data.  Do I assume correctly that a comma separated or space separated list of template names in the mod parameters would work?

Bill Herndon

Lindell-Herndon Genealogy

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...