Style Switcher only in specific pages and Reset CSS

December '13 Joomla Template
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Tue Jul 04, 2017 4:26 pm
Reply with quote
Report this post
Hi.

I'm working on diferent styles to make an option like Night Mode (from Twitter) available at specific pages.
The challenge is that I just want it to work on long text pages (like this: http://www.cafecomfilme.com.br/criticas/critica-do-filme-ao-cair-da-noite ), but I dont want it showing on other pages.

Right now, I limited this option by making a copy of the Game Template, so I hide the GkStyleArea on every other page.

So, I want the GkStyleArea showing only on the K2 Items of this specific category, but not in the category.

And I'm also trying to figure out a way to reset the CSS files when loading a different page, because after enabling an Style on an Item like that, the CSS is enabled in the whole website. Any way to do that?

Any help is appreciated.

Thanks in advance!
User avatar
Fresh Boarder

GK User
Thu Jul 06, 2017 3:38 pm
Reply with quote
Report this post
fabiojordan wrote:And I'm also trying to figure out a way to reset the CSS files when loading a different page, because after enabling an Style on an Item like that, the CSS is enabled in the whole website. Any way to do that?


I solved this with a copy of the template, so the one that shows on every other category has to get the "Style Switcher" option disabled.

Still trying to figure out an easy way to disabled this field on the category page.
User avatar
Fresh Boarder

teitbite
Sun Jul 09, 2017 10:35 am
Reply with quote
Report this post
Hi

I think easiest would be to make a separated menu and add each category page as a menu item. This way You will be able to attach template styles for this pages.
User avatar
Moderator

GK User
Thu Jul 20, 2017 11:28 pm
Reply with quote
Report this post
Hi, teitbite.

I always used my menu like this, with separated menu items to each category. But I was still having the problem with the CSS, since when I enable a different style in an article of that specific category and than I get back to the category page, the CSS was recorded from the article, showing a different background.

So, now, I have a solution. I just added an Custom CSS inside the Theme options, so before the website loads another CSS, it gets some rules direct from the inline.

And I just thought that another way is to change the style from the K2 category file of that specific page, changing the ID or the class, the website wont load that code activated in the article :D

Anyway, thanks for the help, and hope my solution helps someone else.

Best regards :D
User avatar
Fresh Boarder

teitbite
Wed Jul 26, 2017 2:06 pm
Reply with quote
Report this post
Hi

Ok. Great to hear that. Indeed, now I see I've misunderstood You. My solution would only show/hide a style selection on pages, but selected style is stored in cookies, so it would not make a difference per pages as You've needed to have it.
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.