Hi,
I would like to give unregistered users the option to change themes without being logged in. So it doesn't need to be stored in a cookie or anything, next time they visit my site, they see the default theme again. Registered users can set their theme under My Account as usual, but they can of course also change a theme for just that session. I would like this to be done through a side block, that lists the themes.
I have seen a block that let's registered users change their theme through a sideblock, but I want to make this available for unregistered users as well.
I have been looking around for this, but maybe anyone of you can guide me in the right direction how to do this. Or is there a block available?
THIA
Gurt
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- Guite responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 05:53 PM
- frw responded to »Bug in the SMTP mail transfer protocol - Port 25 - Zikula 1.2.9« 22. May
- mdee responded to »Short URL questions« 22. May
- mesteele101 responded to »Problem in Database Connection« 21. May
- Herr.Vorragend responded to »Clip Documentation and Doubt« 19. May
- mazdev responded to »zikula 1.3.3. and IE9« 19. May
- mesteele101 responded to »How to install Zikula for MSSQL ??? - Part II« 19. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Allow unregistered users to change theme?
-
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Dec 11, 2003
- Posts: 20
Hi,
Linking them to index.php?theme=<themename> would be a possibility, so they can preview a theme without having to register or login or whatever. You could easily set that up in a HTML sideblock or something.
I believe there is also a block for this ... try searching blocks.postnuke.com. I don't know if it's on there, but I've definately seen someone write and release such a block somewhere.</themename> -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 163
Quote
I believe there is also a block for this ... try searching blocks.postnuke.com. I don't know if it's on there, but I've definately seen someone write and release such a block somewhere.
Don't there there is, but you can use the "Generic Menu" block and use index.php?theme=<themename> as the menu selections. I am setting it up on my site now.</themename> -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 286
I would like to do this as well, basically giving low bandwidth users the option for a text only site. However the way you have suggested will only hold for the page they are on? So if they visit other pages the site reverts to the default theme?
Cheers -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 163
Yes it will revert back to the default theme afterwards. The block I have is on the right side, but you can place it on the left side so people can see how things look with different modules and the like. -
- Rank: Legend
- Registered: Dec 11, 2002
- Last visit: Oct 21, 2009
- Posts: 11674
I dont believe it would be possible to change themes for unregistered users (permenantly) without a substantal code hack. There is no block or module that I know of that does this.
--
itbegins.co.uk - Zikula Consulting
birtwistle.me.uk - Personal Blog
Please read the Support Guide -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2
Quote
Quote:
I believe there is also a block for this ... try searching blocks.postnuke.com. I don't know if it's on there, but I've definately seen someone write and release such a block somewhere.
Don't there there is, but you can use the "Generic Menu" block and use index.php?theme=<themename> as the menu selections. I am setting it up on my site now. </themename>
could someone post on how to do this? cause that would really help -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 163
Quote
could someone post on how to do this? cause that would really help
If you want to have it where it is a change for each user - they will have to be a member. The way to do this is to go to Administration -> Settings -> Check YES with 'Allow users to override theme?'
If you are talking about setting up a Menu Block to allow people to temporary change the theme to see how a theme looks without making it fixed. Here is how it is done:
Administration -> Blocks -> New Block -> Core/Generic Menu
Also select which side block to use: Left or Right
Click 'Commit Changes'
Then in Title place the name of the theme
In URL place 'index.php?theme=xpZone-camo' (change theme= to what the name of the theme is)
In Description, you don't have to put anything.
Click Commit Changes. Then move the block up or down as needed.
Repeat till you have all the themes you want listed -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
Achieving this is technically feasble but I don't currently have time to write the necessary code but maybe I if post a rough howto then somebody could pick it up. This also needs a modifcation to a core API function.
The key here is that even unregistered users have a session in the DB. What we can do is make a theme 'stick' for an unregistered user for the duration of thier session (note if you use high security then is only for the duration the browser is open).
Steps to implement would be
1. Modify the theme selection block (as posted earlier) to set a session variable when the theme is changed (e.g. pnSessionSetVar('mytheme', $themename))
2. Modify the pnUserGetTheme API (in includes/pnUser.php) and added code the check for the existence of the previous set session variable and return the approapriate value.
-Mark
- Moderated by:
- Support
