The individually-styled channel feature is awesome. seems like it would be double awesome if it was extended to also theme the users 1) profile page, 2) contact page, and 3) Views of the user's nodes. The first two seem easy enough. Themeing the View page of the user's nodes could be a challenge. Logically if a View establishes a relationship with the node author, then the View could use the author's chosen theme if requested by themekey.

I could use all three of these additions. Let me know if you think there is a future for this feature request or if not could you propose some PHP snippets or a means to accomplish this? Thanks for any help.

Comments

webservant316’s picture

For the themeing of the View perhaps I could create a new page type and template that printed out my View. Then when the user created this new page it would be themed as he specified because he is the author. The page template itself would then also print the View. As long as I can programatically call the View with the current arguments at that point. Since the View needs the node author name, if the page URL contains the node author name, hopefully I could grab it from there.

Though that makes the installation of numerous themes cumbersome.

webservant316’s picture

To solve this problem I think I can use Viewreference and assign the fieldtype to a node type. Viewreference will also let the admin set a default using PHP code. Thus I could pass the node author's name to the View. Then I could use field_permissions to only allow the Drupal admin to edit this field. Viola, a node themed by the author's preference that displays a View of the author's nodes.

webservant316’s picture

Now I need a solution for the 1) user contact page and 2) the user profile page.

mkalkbrenner’s picture

Title: extend individually-styled channels to include the user profile page and contact page » extend individually-styled channels to include the user profile page, contact page, and Views

I will start working on 1) and 2). Afterwards I will simplify the user interface to deal with it.

mkalkbrenner’s picture

Title: extend individually-styled channels to include the user profile page, contact page, and Views » extend individually-styled channels to include the user profile page and contact page
Version: 7.x-2.5 » 7.x-3.x-dev
Component: Miscellaneous » Code / API
Assigned: Unassigned » mkalkbrenner
webservant316’s picture

Title: extend individually-styled channels to include the user profile page, contact page, and Views » extend individually-styled channels to include the user profile page and contact page

excellent, thanks!

mkalkbrenner’s picture

Status: Active » Needs review

I just committed the first draft to git. It already includes the simplification of the user interface. The simplification is not optional anymore, because the usability was very bad without it.

Are you able to checkout 7.x-3.x and test it?

If you want to switch the user/#uid/edit form as well, you have to disable core's administration theme feature completely. Or use ThemeKey Compatibility to integrate the System module with ThemeKey and let themekey_ui:author_triggers_theme take precedence over themekey_compat:module_system_triggers_theme.
(I recommend the second approach)

I still have to do some more testing regarding blogs and caching.

webservant316’s picture

thanks. I hope to test the feature tomorrow.

webservant316’s picture

1. Themekey 7.x-3.x upgraded from 7.x-2.x without error on screen, logs, or php error log. Good.

2. User selected theme evident on their profile and while editing profile. Good.

3. User selected theme evident on their contact form. Good.

4. User selected theme evident on user's blogs and pages and while editing. Good.

5. Tried UNsuccessfully to apply users selected theme to the 'add' page. Instead of staying on the current theme the 'add' page always switched to the default theme. Need help with this.
This is checked ~ Retain the theme until a new theme is set
This is checked ~ Retain the theme until a new theme is set for anonymous users
This is checked ~ Compatibility > Integrate Modules in... Rule Chain > System (Admin theme)
Administration theme set to - 'default theme'

If did notice that there is a new(?) Theme Switching Rule Chain that assigns the wildcard path to the default theme. I don't think I had that rule there before. Did this upgrade automatically add that rule? Why does the rule need to be there? Perhaps that rule makes it so that Themekey always has a theme assignment for every page so that the 'Retain' theme checkbox no longer functions.

6. Wording suggestions...

On page ~ /admin/config/user-interface/themekey/settings/ui
Let the user select a theme that will be used to display all content she creates.
Assign themes from user profile. All content created by a user will be shown to all visitors
using the theme she selected in her profile. This also includes the user's contact
form, profile page, and blog pages.

Let the user select a theme for only her blog pages
Assign themes to personal blogs from user profile. Requires "Let the user select a theme
for her nodes in her user profile" to be activated.

On page ~ /admin/config/user-interface/themekey/settings/compat
This feature seems like it could use more words of explanation. I still don't really understand it.

7. Also, got this error most times after running cron...
Notice: Undefined index: themekey_ui:blog_author_triggers_theme in themekey_cron_clear_page_cache() (line 34 of /home/adminw/public_html/drupal.www.waterpa.com/sites/all/modules/themekey/themekey_cron.inc).

8. Lastly, Got this error when editing an existing page, but deleted the page and started over and didn't see the error again...
===
Notice: Undefined index: article_node_form in drupal_retrieve_form() (line 764 of /home/adminw/public_html/drupal.www.waterpa.com/includes/form.inc).
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'article_node_form' was given in drupal_retrieve_form() (line 799 of /home/adminw/public_html/drupal.www.waterpa.com/includes/form.inc).

mkalkbrenner’s picture

5.
- Disable "Retain the theme until a new theme is set"
- Disable "Retain the theme until a new theme is set for anonymous users"

If did notice that there is a new(?) Theme Switching Rule Chain that assigns the wildcard path to the default theme. I don't think I had that rule there before.

I don't think that ThemeKey created that rule itself. If no other rule is missing, you should delete it.

If you send me your skype name via mail we can have a look at your configuration to figure out why the add page is not using the right theme.

6. I'm not a native speaker ;-)

Let the user select a theme for only her blog pages
Assign themes to personal blogs from user profile. Requires "Let the user select a theme
for her nodes in her user profile" to be activated.

This one should not exist anymore. Update from git and try again.

7. Same. Update from git.

8. This does not seem to be related to ThemeKey

mkalkbrenner’s picture

the 'node/add' issue has been fixed by this commit: http://drupalcode.org/project/themekey.git/commit/c3e1164

mkalkbrenner’s picture

I recommend that you update to the latest git version, apply my suggestions from #10 and repeat your tests.

webservant316’s picture

hmmm, trying to figure out how to download get the latest commit.

webservant316’s picture

ok - got it.

webservant316’s picture

I copied the three revised files from your git link above and installed.

1. Themekey 7.x-3.x upgrade to 7.x-2.x. Not re-tested, I assume good.
2. User selected theme on their profile and while editing profile. Still good.
3. User selected theme on their contact form. Still good.
4. User selected theme on user's blogs and pages and while editing. Still good.
5. User selected theme on 'add' page. Good
Unchecked ~ Retain the theme until a new theme is set
Unchecked ~ Retain the theme until a new theme is set for anonymous users
Still checked ~ Compatibility > Integrate Modules in... Rule Chain > System (Admin theme)
Administration theme still set to - 'default theme'
Deleted my Theme Switching Rule Chain that assigns the wildcard path to the default theme.
(I may have created that rule and forgot what I did. Rule not needed and deleted).

6. Wording suggestions? I didn't see the changes after updating the three files.

ON PAGE ~ /admin/config/user-interface/themekey/settings/ui

Let the user select a theme that will be used to display all content she creates. Assign (THEME not themes) from user profile. All content created by a user will be shown to all visitors using the theme she selected in her profile. This also includes the user's contact form, PROFILE PAGE, and blog AND OTHER pages. Requires THE PERMISSION "Let the user select a theme for her nodes in her user profile" to be activated.

Let the user select a theme for ONLY her blog pages. Assign (THEME not themes) to personal blogs from user profile. Requires THE PERMISSION "Let the user select a theme for her nodes in her user profile" to be activated.

ON PAGE ~ /admin/config/user-interface/themekey/settings/compat
This feature seems like it could use more words of explanation. I still don't really understand it.

ON PAGE ~ /admin/people/permissions
Assign theme to own content. Let the user select a theme that will be used to display all content she creates.

You may want to delete that last sentence and let that one permission clearly apply to both the blog only AND the all content user theme selection options.

7. Got an error after running cron. Super, error is gone.
8. Lastly, got another error... Agreed, unrelated.

QUESTIONS
1. What additional testing ideas do you have? Hopefully you are testing as well.
2. Hoping to move this release out of alpha before I use in production. What is the time frame for that and what other 'alpha' changes are in 3.x?

mkalkbrenner’s picture

I copied the three revised files from your git link above and installed.

Don't do that. Now you missed some commits. You have to use a git client.
Due to the fact that you did not find more bugs I will release an alpha2 now which you can use for further testing.

6. Wording suggestions? I didn't see the changes after updating the three files.

Yes, because the changes are in different commits. I suggest that we fix the wording between alpha2 and beta1

Hopefully you are testing as well.

Sure. Additionally I created automated tests for these features. But I missed the node/add use case. When I fixed it, I created an automated test as well. And I do stuff like checking the cache_page after modifications. But it is always good to have a user doing independent tests.

Hoping to move this release out of alpha before I use in production. What is the time frame for that and what other 'alpha' changes are in 3.x

3.x is currently declared alpha because of it's new features which are not yet used frequently. If you don't use the new features, you can consider 3.0-alpha as stable as 2.x. Basically the new features are:
* support for browscap
* switch theme by field value
* Domain Theme support
* support for mobile_detect
* support for mobile_detect_api
* Workbench Access support
* new sub-modules: ThemeKey CSS and ThemeKey Redirect

webservant316’s picture

super. I'll install alpha 2 as soon as I see it.

webservant316’s picture

I just installed 3.x-alpha2. It works great, thanks. The user's selected theme was displayed to them and other users when viewing blog pages, other pages, their profile, their contact form, and also while they edited their pages or added pages. I also saw your fixes to the wording. I also changed the user's theme selection and the theme changed immediately for them and other users on all pages. Cron also runs successfully. No errors observed in the Drupal logs or PHP error log. Looks good.

You say above in #7

If you want to switch the user/#uid/edit form as well, you have to disable core's administration theme feature completely. Or use ThemeKey Compatibility to integrate the System module with ThemeKey and let themekey_ui:author_triggers_theme take precedence over themekey_compat:module_system_triggers_theme.
(I recommend the second approach)

All the above tests worked fine for me without even enabling 'Themekey Compatibility'. However, maybe that is because at '/admin/appearance' I have 'Use the administration theme when editing or creating content' unchecked. Is that what you mean by 'disabling core's administration theme feature completely'? Also why is one method preferred over the other?

Also note on this last round of tests I fully uninstalled Themekey and re-installed fresh.

mkalkbrenner’s picture

You're right. Disabling 'Use the administration theme when editing or creating content' only is the third option.

I just recommend to use ThemeKey Compatbility to keep the admin theme feature and the 'Use the administration theme when editing or creating content' for users who don't enable a personal theme or are not allowed to do so (permissions).

Are there more wordings to fix?

webservant316’s picture

If I understand properly you may want to make these changes...

@ /admin/modules
Change this...
"Integration of different theme switching modules into ThemeKey and its theme switching rule chain."
To this...
"Integration of additional modules to allow ThemeKey to retain control in the theme switching rule chain when Administrative, Views, and other theme selection options are also used."

@/admin/config/user-interface/themekey/settings/compat
Expand this...
"Integrate Modules in Theme Switching Rule Chain"
To this...
"Integrate Modules in Theme Switching Rule Chain. These modules allow ThemeKey to retain control in the theme switching rule chain when Administrative, Views, or other theme selection options are also used."

@/admin/config/user-interface/themekey/settings/ui
Expand this....
"Assign themes from user profile. All content created by a user will be shown to all visitors using the theme she selected in her profile. This also includes the user's contact form, profile page, and blog pages."
To this....
"Assign themes from user profile. All content created by a user will be shown to all visitors using the theme she selected in her profile. This also includes the user's contact form, profile page, and blog pages. If Administrative theme selection options are used ThemeKey Compatibility must be enabled and configured to allow ThemeKey to retain control in the theme switching rule chain for 'edit' and 'add' pages."

* minor grammatical note. It is curious that in English there is no gender neutral personal pronoun. So unfortunately it forces one to choose between 'he' or 'she'. The common solution is to go plural. So this "she selected in her profile" would be this "they selected in their profile".

webservant316’s picture

what work remains to call this feature closed (fixed)?

mkalkbrenner’s picture

Status: Needs review » Fixed

I just added your improvements to the strings: http://drupalcode.org/project/themekey.git/commit/bcc0829

From my point of view the feature is complete and 3.0-alpha2 is already usable in production (as long as you don't enable the new sub-modules ThemeKey CSS or ThemeKey Redirect).

beta-1 will be released as soon as I created some more automated tests for the new modules mentioned above.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.