Closed (fixed)
Project:
ThemeKey
Version:
6.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
26 Apr 2009 at 18:54 UTC
Updated:
11 Jul 2011 at 07:32 UTC
Jump to comment: Most recent file
Comments
Comment #1
mkalkbrennerComment #2
mkalkbrennerSomething similar is already available:
1. On /admin/settings/themekey/settings turn on "Discover all node properties for selection"
2. Use property node:uid to select a theme according to the author of a node
Now the feature request is to allow the author himself to select a theme for all his nodes. Probably in his profile settings ...
Comment #3
mkalkbrennerComment #4
mkalkbrennerComment #5
mkalkbrennerComment #6
mkalkbrennersee #855120: Themekey to change theme based on node's author, from a setting in user profile
Comment #7
sansui commentedI totally forgot about this thread :) But the other thread I created still stands
So is it not currently possible to create a module or addition that would do this in combination with themekey?
Basically:
1.) User selects themekey setting in profile
2.) Helper module creates new themekey rule for selected user/theme
3.) All users now see the author's selected theme when viewing that author's content
Comment #8
sansui commentedWhat I'm thinking of doing is creating a small module to provide a new tab and form in the user profile, that lists the available themes on the site with checkboxes for the users to select from. What I'm trying to figure out is how I should update the themekey_properties table. I found the function for themekey_rule_set - can/should I use this vs. updating the table directly? In my configuration, there would only be one rule per UID, so it seems like I could just update the table directly myself
Then again, I'm not a programmer, so maybe I'm missing something important :)
Comment #9
mkalkbrennerThis feature has to be implemented using ThemeKey UI to add a nice theme selection box to the users Profile (maybe as tab).
Than we have to introduce a new "static rule" using ThemeKey UI's API.
Everything we need is already in place. Please do not touch the database like you described above.
Comment #10
mkalkbrennerIt took me some hours but here is the patch. (BTW it was impossible to implement this feature on ThemeKey 6.x-1.x architecture.)
After applying this patch (or download ThemeKey 6.x-2.x-dev > 2010-07-17) you can activate the feature like this:
1. Install (or update) ThemeKey UI.
2. Visit "/admin/settings/themekey/settings" and save the settings. That is necessary to force ThemeKey to scan for new properties. (I hope to provide a better solution for ThemeKey 6.x-3.x)
3. Activate "Show theme option in user profile" at "/admin/settings/themekey/settings/ui".
4. Move the static rule "themekey_ui:node_author_triggers_theme" to the postion it fits your needs at "/admin/settings/themekey".
5. Adjust the role settings for "assign theme to own nodes" at "/admin/user/permissions".
6. Test this new feature and create a tutorial like "Rule Chaining: Using a special theme for content creation depending on user roles" which you can find at "/help/themekey" => tutorials ;-)
Feedback is welcome!
Comment #11
sansui commentedWow, that was some quick work - I'll be back where I can test this out in a couple hours, so I will check this out ASAP for feedback and more :)
Comment #12
sansui commentedI was able to successfully patch and update my themekey module, enable the user interface option, and select the new theme for a test user. I tested with both the admin account and a sub user account, swapping themes multiple times and checking the view from each account.
When viewing that user's content, the theme changed as expected. Very nice work :)
Comment #13
mkalkbrennerwaiting for documentation
Comment #14
sansui commentedI'll put together something tomorrow with some screenshots. There is some wording that needs to be fixed in admin interface
Under admin/settings/themekey/settings/ui, the help text for the checkbox "Show theme option in user profile" should say something like "Assign themes from user profile. This will show a 'Theme' section under "edit" in user profiles.
Currently it says same as create/edit node forms.
Comment #15
mkalkbrennerI adjusted the description. Thanks for the hint.
Comment #16
sansui commentedSomething else I noticed was if a user selects a theme, and then you disable the theme in theme selection - the disabled theme is still shown for that user's content. That's not a problem for my functionality, but thought I would mention it in case it should behave differently (like defaulting to main theme)
Comment #17
sansui commentedWasn't sure what format you wanted me to give you the tutorial in, but I just pasted this into my themekey_help.inc based on your existing tutorial example. Images attached in this post
Comment #18
sansui commentedMissed the third image attachment in the previous post
Comment #19
mkalkbrenner@ #16 Sansui:
It works in my test setup. Maybe this could be caused by page caching. See #812114: Support for page caches (internal and external like 'Boost').
What happens if you clear the cache?
Comment #20
sansui commentedComing back to this post after a while :)
I've noticed that in the account area, if you have multiple pages under "edit" that are added by other modules (for example, I have a billing module that has an additional page there), then the selection fieldset for themekey shows up in these other pages as well
It's a small detail, certainly not critical, but thought I would point it out :)
Comment #21
vlnm commentedIs it normal, that the feature described in this issue doesn't allow to change list pages of a blog (for example with url like http://mysite.com/blogs/coolblogger). It seems to be pretty expectable for a user to be able to control appearence of such pages, not only of content pages, isn't it?
Or, maybe I've done something wrong installing and setting up ThemeKey?
Comment #22
mkalkbrennerThis feature only affects nodes.
But as admin your able to set up a rule that sets a theme for this url.
Comment #23
vlnm commentedYes, I can do it manually. But if there are dozens of users on my site and each of them has a different theme it would be a very boring job.
Can you, may be, guide me a bit of how to extend current rule themekey_ui:node_author_triggers_theme to apply user-chosen theme on list page too? I’m familiar with php but couldn’t understand how to do it with ThemeKey from the first attempt.
Comment #24
mkalkbrenner