Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
a Summer night - @152.25
Activity rating: Three Stars Posts & Arts: 42/1k.beats Random | Recent Posts | Guild Recents
News: :4u: ~~~~~~~~~~~  :4u: Guild Events: Summer Projects

+  MelonLand Forum
|-+  Projects & Art
| |-+  ☆ ∙ Web Projects
| | |-+  How I jailbroke joomla's template restrictions


« previous next »
Pages: [1] Print Embed
Author Topic: How I jailbroke joomla's template restrictions  (Read 81 times)
Noah_S
Sr. Member ⚓︎
****
View Profile WWWArt


Noah. Earth. I make website. I.. I.. Noah. Earth.
⛺︎ My Room
iMood: Noah_S
RSS: RSS

Guild Memberships:
Artifacts:
Visited on Melon's 10th Anniversary!I got robbed by Dan Q on Melonland!I met Dan Q on Melonland!A coin!EnbyAce
« on: a Summer day » Embed

I use joomla (a CMS) to build my website, and astroid frameworks (a joomla addon) for template management.

They have the modern restriction of the only user customization being a light/dark switch. I was not happy with this. They'd let me make more templates, but I could only assign them to predetermined pages.

I successfully made a custom module that let the user pick between an unlimited amount of templates, but the selection reset upon going to another page. This is the code for the template picker.

Code
<form id="templateswapform">
<label for="template">Choose a template:</label>
<select name="template" id="template">
<option value="astroid_template_two_pink_blue">Pink and pale blue (light)</option>
<option value="astroid_template_two_purple_green">Purple and green (dark)</option>
<option value="astroid_template_two_orange_pale_green">Orange and pale green (light, animation)</option>
</select><input type="submit" value="Choose">
</form>

You can see it in action here. It's an oldschool expanding options form with a submit button. As you can see, it has 3 options. Pink and pale blue (light); Purple and green (dark); Orange and pale green (light, animation). The values attached to the options are their names on the backend, the options are the text that the form displays when you use it to pick a template.

I spent a few days stuck at this stage, attempting to get joomla to accept a cookie with the chosen template and then display it. I couldn't do that. So I started thinking outside of the box.

The astroid frameworks backend editor lets me make individual changes to each template without affecting the rest of them. This includes which items will be displayed to visitor. Items like menus on the left of my content.

And yesterday when I made my custom error 404 page, I had only inserted the code for it in my default template. My default template is one with a light/dark switch that's not displayed among the options in the code above. Unless told otherwise, that's the one that joomla will show you. After I made the error 404 page, I went to put a link to it in the "just for fun" menu. And I saw that it was asking which template to use when visitors click on the link.

This morning I put those 2 things together for an experiment. I opened the template called astroid_template_two_pink_blue (a template that's the only light version of the default one; astroid_template_two_purple_green is the only dark version of default) and went on to remove the menu and replace it with a template exclusive. On the backend that menu is called "Main menu pink blue", but it shows only "Main menu" to visitors.

When I opened a page in the pink and pale blue template, there was no menu. But joomla lets you link to the same content (that stuff in the middle column on my website; code for it is stored separately from everything you see around it and can be called for insertion) with as many menu items as you want. So I took that template exclusive menu and filled it up with links to the same content, except in the field where it asked which template to load, I selected astroid_template_two_pink_blue. Then I repeated the process for the just for fun menu, and did the same thing for the purple and green template.

I had now successfully made joomla keep the user selected template for menu navigation.¨

And I wasn't done yet. The whole point had been to give more than 2 options. So I made an orange and pale green template in astroid and repeated the process with the menus. And then I added a somewhat modified cursor trail script to that one where I had changed some numbers and accidentally added a delayed confetti trail. I have no idea how, but it's there and I like it. I did this because I can now do animations as an opt in feature.

During the past week, I also asked for help on the joomla forum and was given less than helpful advice like "make a plugin" and instructions on how to make a light/dark switch. Which I already had and my first sentence was that I want more than 2 options.

But thinking outside of the box worked.

Logged

perfectionist_better.gifweb_designer.gifspeed_of_time.gifbutton290.pngmy_dream_wedding.gifClippy beats AI

Artifact Swap: IT'S THE FINAL COUNTDOWNPaw printLarge watercraftGrowing ballLucky!Melonland has encountered a bugMerry ChristmasMessage BuddyMelon bite
Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | Send Feedback | Supporters ♥ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi
@000 MelonLand Zap! Want to Login or Join ? Forum Art Hub Chat Webring Editor Recent Edits Tenement Arcade Web Guides Graphics Catalogue Wiki Newsletters Image Stream
Melon's Sites TamaNotchi Textures PixelSea GifyPet MoMG Ozwomp Online Loom Videos Leaky Webring Melonking
Tools Melon Software ArtHub Embed Maker ML Passports
Outlinks Webrings Internet Phone Book HTML Energy Declarations Hackers & Designers Frutiger Aero Forum m15o's Web Services 32Bit Cafe iMood
Minecraft: Online
Join: craft.melonking.net