set a theme for a user in Moodle - themes

Within a Moodle, I've set up, I receive new users via a single sign on, these users should get a specific theme set for them. This theme is not the default theme, other users can sign up for the site (they are not coming in via the SSO) and should not get this theme, so I can't set it as the default theme.
How can I set a theme as the prefered or default theme for a user when he logs in via the SSO?
I would think that this setting is stored in the database but I can't find it there.
I found a column theme in the user table but setting the theme there does nothing.
I've also looked in the table user_preferences but didn't find any record about the theme after I changed it for a specific user.
Does anybody know where in the database this is stored or how I can set a default theme for a specific user?
UPDATE:
Users can change their own theme.
I store the themename in the column in the database (clean, NOT theme_clean).

You probably need to enable user themes - allowuserthemes
Go to site admin -> appearance -> themes -> theme settings
or direct to /admin/settings.php?section=themesettings
UPDATE:
How are you storing the name in the theme column? It should be mytheme rather than theme_mytheme.
If that's correct, then try changing the theme order : in config.php add
$CFG->themeorder = array('user', 'course', 'category', 'session', 'site');
You'll need to log out and log in for the themeorder to be updated.
If none of the above works, then I would either do a var_dump($USER) after a login to see if theme is updated correctly. Or start a debugger and step through function resolve_theme() in /lib/pagelib.php

Related

Filter courses on Moodle 2.7

I am wondering if there is any plugin available for Moodle 2.7 which allows admin to add some attributes to courses and create a widget to filter the courses by thoses attributes.
For example, we would like to allow users to filter courses by their price, content, dates etc.
Thanks in advance
The block gnuwings provided will actually solve your issue when configured within Moodle correctly.
What you should do afterwards, is enable the 'My Moodle' page for every user. To find this setting, you should use the search function for the site admin.
My Moodle allows you to place blocks in the center of the screen, so you can edit the default My Moodle page to show this block. I would personally recommend turning the feature that allows students to edit their own My Moodle page off, as this will make it harder for you to manage this page in the future (without modifications to the database).
To edit the default 'My' page, in Moodle 2.7, go to site administration, appearance, default my page.
To enable this view by default, go to site administration -> appearance -> navigation, and update the value of 'Default home page for users'.

Magento multistore default settings

I have a problem (suddenly) with the defaults settings for a product. We have a multistore setup with several languages. When we create a new product, we put in alle relevant data for the product.
When we switch to another store view, all the "Use Default Value" checkboxes are unchecked.
Normally they should be checked by default, now it is unchecked by default?
We only need to change some things to another language, most things should keep the default setting.
This started a few days ago, the only thing we changed on the setup during that time is adding some extra modules or emptyd some log tables in the database?
Does anyone have any clue where I can correct this behaviour and have all the "Use Default Value" checkboxes checked by default again?
be sure that in file app/design/adminhtml/default/default/template/catalog/form/renderer/fieldset/element.phtml or (find the same file in your custom admin theme if You use it) in line 55 input has attribute checked="checked".
Also check in Mage_Adminhtml_Block_Catalog_Form_Renderer_Fieldset_Element method usedDefault() and see you error logs.

Magento PayPal Express not showing

I have a pretty standard Magento installation (Magento ver. 1.7.0.2) and I have enabled PayPal Express settings (Including API username. password & Signature all filled in). I have set the default theme to blank so that it doesn't use any of my template files but the button is not showing on any pages (product, basket or checkout - These options are set to show in the admin).
So even with the default Magento theme non of the paypal buttons show up.
Anyone seen this before? Can anyone shed any light on this?
Thanks
edit p.s. Mage_Paypal & Mage_PaypalUk both enabled in Advanced.
its seems like you have enabled paypal with another configuration scope ..Not in Default configuration scope or may be you have disabled paypal exp in your current configuration scope. It will override Default configuration scope even you enabled in Default configuration scope. Make sure about this..
Just go to your database. open core_config_data table enable to view all datas with one page. Here you can see all your paypal configs. If you see any paypal configs with websites or something not like default in scope field then you have configured paypal for your current configuration scope.
Update :
consider your current config scope is website. In your core_config_data table set value to "1" for this payment/paypal_express/active for only the other config scopes (website) not the default. Just have a look at the following image. Then check again..It should be work now..!

How to select theme based on URL in Orchard CMS

Suppose, I have a site named test.com and it has a selected theme of-course. Now I have other tenant site named alpha.test.com for which a theme is used also.
But I want to select the theme for the alpha.test.com from codes where orchard used to select theme. How it is? Please help.
My another question is how to select different theme for different controller or actions in Orchard CMS.
Just implement your own IThemeSelector and use a higher priority than the default one. Do not alter the existing one like has been suggested.
I think these links may help you:
https://orchard.codeplex.com/discussions/359115
http://weblogs.asp.net/bleroy/dynamically-switching-the-theme-in-orchard
There are no tables containing installed themes in Orchard but Themes_ThemeSiteSettingsPartRecord table is used to store the record for current theme only. If we want to select multiple/another theme based on URL then
Ans1 & Ans2: Specify the currentThemeName variable with desired installed theme Name in GetTheme method of SiteThemeSelector class located in Orchard.Themes/Services. If you want to apply different theme based on URL then set currentThemeName inside logic and URL may retrieved from context.HttpContext.Request.

Magento Multi Store themes calling same login.phtml file

I'm new to magento. Currently i'm developing two ecommerce sites using multi-store option in magento. Both the sites are 90% over, last night when i planned to customize the login page i was shocked. The reason is the changes made in first store login page also reflecting in second store also. The login page is curently calling from
frontend/default/default/template/persistent/customer/form/login.phtml
Is it possible to give any custom login page? PLz guide me magento experts......
Please update your post with your frontend/ folder structure down to each theme template folder. It might be that you don't have a copy of login.phtml in the second theme. Moreover you should follow templates best practices as:
Always create for a new shop different packaga. So not
frontend/default
but
frontend/yourcustompackage
Always have default theme left as much untouched, as possible. So in the
frontend/package/default
Should be some basic changes and rules of your package. It means for example in the putting reset.css for all of your themes. Or something like this.
As for me, each store view should have own theme. So, for example, storeview1
frontend/package/storeview1/
There you copy and change files specific for this theme. So, for example, in default you might have login.phtml. But you want storeview1 to have another login.phtml and in storeview2 it should be the same as in default. Therefore you copy the login.phtml from default to storeview1 and change it there. Don't forget to change package and theme in System->Configuration->Design. Package should be change for whole shop and theme should be specified for every store view or left untouched for default.
P.S. Magento theme fallbacks
P.P.S. Try this tutorial or google another one
P.P.P.S. I hope, you got the answer for your question.

Resources