Can't update/modify themes....Why?

Can't update/modify themes....Why?

by Tony Dopun -
Number of replies: 36
Hey guys.

I've found that I can't modify the design any of the pages in any of the themes.

I tried to change the color of the main title. Simple enough right? So I located the CSS for that theme and changed the color. It didn't reflect on the pages though. I restarted Moodle, and yet again.. no dice. I restarted the server itself and still nothing.

I added a few changes in some of the php's, mainly simple echo tests just to see if they would render on the pages. Still nothing.

Is there some secret that I am not aware of to updating these pages? If so please let me know. Any help is appreciated.


Tony
Average of ratings: -
In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Tony,

What is your server setup?

Jon
In reply to Jon Witts

Re: Can't update/modify themes....Why?

by Tony Dopun -
It's a basic box with Windows Server 2003, Enterprise Edition, Service Pack 2.

Do you want precise server specs? I'm extremely new to Moodle so I'm not sure exactly what information would best help...

In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The versions of PHP, Webserver, Database server and Moodle would be helpful.

Jon
In reply to Jon Witts

Re: Can't update/modify themes....Why?

by Tony Dopun -
PHP: 5.2.9.9
Webserver: Apache 2.2.11
Database Server: MySql 1.2.17
Moodle: Moodle 1.9.5 (Build: 20090520)

Hope this helps.

Thanks Jon.

In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Tony
Have you tried downloading the standard theme, making the changes into there and then reuploading with a new name - ie, adding it as a new theme?
In reply to Mary Cooch

Re: Can't update/modify themes....Why?

by Tony Dopun -
I just tried this Mary and it still didn't work.

Is it possible that I'm just not fully understanding how the PHP's are calling the stylesheets in?

What I'm trying to do at the moment is simply change the color of the title at the top of the page. The
surrounding the page title is calling in a CSS class called "headermain".

I've confirmed that I'm in the correct CSS as that is what is specified in the config.php. Maybe there's a PHP that is overriding the config.php? I don't know. What I do know is that none of the changes that I'm trying to make are sticking...
In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Teresa Gibbison -
Hi Tony
Can you check that you have the correct them selected for your site via Administration ► Appearance ► Themes ► Theme Selector (it sounds silly to ask but I have been know to alter a theme setting and get frustrated because I forgot to change it! Also try a refresh and a cache clear, again I've been caught out here!) also check that your theme list is not restricted via Administration ► Appearance ► Themes ► Theme Settings or the course you are viewing (if you are) doesn't have a theme set in the course settings page.
Cheers
Teresa
In reply to Teresa Gibbison

Re: Can't update/modify themes....Why?

by Tony Dopun -

Hey Teresa,

Thanks for the suggestions. I checked to make sure I was in the right theme, and I was. I also checked to make sure nothing is locked down, and it's not.

I also switched my theme from custom_corners to some others and tried to make modifications, but I came up with the same thing. None of them want to accept any changes.

Is there some specific process to updating these files that I may not know about? I've been making the changes in the CSS, restarting Moodle, and then refreshing the page.. and nothing. I've cleared the cache as well a few times.

Thoughts?

Tony




In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
When you say "restarting moodle", what do you mean?

Moodle is a web site and as such can not be restarted. Are you restarting your web server?
In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Teresa Gibbison -
Hi Tony
As well as Jon's question can I ask that you confirm the theme folder (full of the appropriate theme files, like config.php) you are modifying is located in '/moodle/theme/' folder (eg. /moodle/theme/mytheme) and that you have sufficient rights to save changes to the files within the folder.
Cheers
Teresa
In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Frank Ralf -
Hi Tony,

Which CSS file(s) did you change actually?

You also might try adding "!important" to your changed rules, e.g. h1 {color: fuchsia !important;}, just to make sure your settings won't get overridden somewhere along the way.

hth
Frank

In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I was working on this bit of the theme code today, and that reminded me what is going on.

The CSS from the theme is sent to the web browser with instructions to cache it for half an hour. That is why reloading the page does not seem to have an effect. If you clear the browser cache, you should see your changes.
In reply to Tim Hunt

Re: Can't update/modify themes....Why?

by Patrick Malley -
When I was in Oklahoma City for the MoodleMoot there, I conducted a 2-hour theming workshop on local Windows installs. Everything was going relatively well until it came time for the participants to actually change their theme and nothing happened.

They would alter the code, save, go back to Firefox, do a hard refresh (Ctrl+F5) and nothing changed. It was really frustrating.

Is it possible that something on a Windows install is caching the files at the server level?
In reply to Patrick Malley

Re: Can't update/modify themes....Why?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I don't think so.

Anyway, in the changed code in Moodle 2.0, if you turn on debugging to DEBUG_DEVELOPER, then it no longer caches the theme files.

By the way, in Moodle 2.0 I strongly recommend that theme designers work in DEBUG_DEVELOPER mode. Where I have had to change things from how they worked in Moodle 1.9, I have tried to add debug messages that point out you are doing the wrong things, and tell you what you should do instead. However, those messages only appear in developer debug mode.
In reply to Tim Hunt

Re: Can't update/modify themes....Why?

by Tony Dopun -
Thank you all for your input. I'll try to answer your questions the best I can.

Jon Witts- Yes, when I say "restarting Moodle" I was referring to my web server.

Teresa - Yes, I am in the appropriate folder (ex. moodle\theme\custom_corners). Regarding your second question about permissions/rights to modify, I have full rights as I am an admin on that server and in our version of Moodle.

Frank - The theme that I am using is "custom_corners" and I'm trying to modify the "user_styles.css". Just attempting simple changes right now. For example adding 'color: #000000;' to the 'headermain' CSS class to change the title color. It's not accepting the changes. I've even cleared the cache and tried reloading the page, in multiple browsers (IE7, FireFox, Google Chrome). Still no dice. I also tried including "!important" on my changes. Nada.

Tim - I tried clearing my cache on multiple browsers and didn't see any change.


I do have a noobie question about modifying the themes. Can I modify one of the themes that is uploaded into Moodle by default? Or do I have to create my own to have custom changes? There was an article linked in Teresa's last reply to me that sparked this question.


Thank you all for trying to help this noob.


Tony






In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
You asked:Can I modify one of the themes that is uploaded into Moodle by default? Or do I have to create my own to have custom changes?
Answer -yes you can modifiy a Moodle theme that's already there (well, you should be able to anyway wink ) but it is not advisable as the changes might be overridden when you upgrade to a new version of Moodle. So what you do is download the theme, make the changes, rename it and then upload it as a custom theme that you have made.
In reply to Mary Cooch

Re: Can't update/modify themes....Why?

by Tony Dopun -
This worked.. kinda. Thanks for the info.

Only thing was it rendered with the change that I had made to the title, which was great. But now I'm going through and I'm running into the same issue again. Elements on the page are not updating with the changes I am making in the CSS.

Do I need to reload this theme everytime I make a change to the front end? What is the best way to ensure that edits/mods will occur real time?


-Tony
In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Frank Ralf -
Hi Tony,

Some CSS settings can be changed in more than one place. Usually the more specific selector wins over the others. For example the color of the title is set with

h1.headermain {
color:#0066FF;
}

But there's another selector somewhere in the stylesheets with a higher specificity:

#header-home .headermain {
...
}

If you set this to "color: fuchsia;" it will override the first setting (see screenshot).

This feature of CSS (the "cascading" part) might be the cause for your changes not showing.

BTW Are you using Development:Firebug or Themes FAQ#Stylish for CSS changes? These tools are really helpful.

Cheers,
Frank

Attachment Custom_Corners_headermain.png
In reply to Frank Ralf

Re: Can't update/modify themes....Why?

by Tony Dopun -
Hey Frank.

Thanks for the input. This is one of the things has really been confusing me, because I've done exactly what you suggested a number of times. I've never had trouble updating/editing pages like this.

Here are the steps that I'm taking:

-Stop my web server.

-Modify my CSS, (I've tried modifying headermain and all of the wrapper div css calls; eg. header-home) trying to simply change the color of the title. Adding "color: #990000;". I've also used "!important" to try to give it some sort of priority.

- Save it, restart my web server.

- Dump the cache in the browser and refresh the page... and no dice.


As far as my design tools, I've always been a notepad++ fan. I have FireBug but I've designed web pages using notepad for the past 8 or 9 years or so, using anything else feels like I'm cheating. ;)


Thanks again for the input.

-Tony
In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Frank Ralf -
Hi Tony,

Have you solved your problem? Otherwise we need more input.

Frank
In reply to Frank Ralf

Re: Can't update/modify themes....Why?

by morgan routledge -
Well, Let me take over for Tony because it appears we are having the same issue and mine is still unsolved.

So just to review, if a change is made to a CSS theme, it is not reflected until I shut down the moodle server, delete the contents of the moodle tmp folder (\Moodle\server\tmp\) and restart the server.

This is not a problem with browser caching or editing the wrong file.

server/debugging messages is set to developer

styles.php was changed to $lifetime = 1;


using:

###### ApacheFriends XAMPPlite Version 1.7.1 ######

+ Apache 2..2.11
+ MySQL 5.1.33 (Community Server)
+ PHP 5.2.9
+ XAMPPlite Control Version 2.5 from www.nat32.com
+ XAMPPlite Security 1.0
+ XAMPP CLI Bundle 1.3 from Carsten Wiedmann
+ SQLite 2.8.15
+ OpenSSL 0.9.8i
+ phpMyAdmin 3.1.3.1
+ Webalizer 2.01-10
+ Zend Optimizer 3.3.0
+ eAccelerator 0.9.5.3 for PHP 5.2.9 (comment in php.ini)

I don't get what's going on. Its like moodle is caching the themes and never updating them. i'm going to start ripping apart the php unless anyone has an idea.

HALP!!
In reply to morgan routledge

Re: Can't update/modify themes....Why?

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
I've only just seen this post, and thought as I read the initial question that there was a simple answer, which I was going to give, but having read the whole of this thread, I'm left wondering if the question was valid.

I've had instances when the CSS chooses to ignore the changes I've made to it, and goes for a default value instead. I use Firefox and a plugin called Firebug which gives an accurate picture of how the CSS works in Moodle.

Most of the time, when I have made changes which, on the face of it, seemed simple enough, the complicated structure of some the themes style sheets makes it impossible to pinpoint where changes have to be made in order to get the result needed. Firebug's 'Inspect Element' shows systematically the parts of the CSS code which relates to the element under inspection. More often than not I found that the browser ignores the CSS in mytheme, and uses values from the Standard theme insead. So no matter how many changes I made to font sizes, or color in my mytheme, the visual result never changed, until I altered the structure of my style sheet.

When you talk about servers and such, then is it not possible to REFRESH the server? One has to do this when making online changes in phpBB (message board OS software).






In reply to Mary Evans

Re: Can't update/modify themes....Why?

by Berenice Weber -
hi Mary, not sure if this will work for you, but I personally combine changing some CSS from my selected theme directly, but as you said, some styles seem to come from the Standard theme, so I altered those, and it seems to work fine for me! So my final page is using some styles defined under my theme and some styles that come from the Standard theme, as I understood, the Standard theme MUST always be in your server, but I just started using Moodle so I am not expert

and YES! Firebug is an excellent tool! don't think I could be a CSS/HTML designer without it... but have you tried also the Web Developer tool? is very handy too! and I actually feel is sometimes "easier" to detect CSS with it than with the Firebug, of course is another Firefox tool, here the link!

https://addons.mozilla.org/en-US/firefox/addon/60
In reply to Berenice Weber

Re: Can't update/modify themes....Why?

by Frank Ralf -
JFTR

Themes FAQ and CSS FAQ are always good starting points.

@Berenice and Mary
It would be great if you could share you experience by enhancing Development:Firebug or Web developer extension on Moodle Docs. Those are wiki pages so "be bold" as the saying goes wink

tia
Frank
In reply to Frank Ralf

Re: Can't update/modify themes....Why?

by A B -
I had the same problem. Maybe my solution also works for you.

I had downloaded the package with moodle and xampp for windows. There was no folder called "htdocs". I now installed xampp seperately and then moodle, like seen here: http://docs.moodle.org/en/Windows_installation_using_XAMPP . After this I had "htdocs" and my css-changes are visible! lächelnd

http://moodle.org/mod/forum/discuss.php?d=125707#p550596

Good luck!
Claudia
In reply to A B

回复: Re: Can't update/modify themes....Why?

by ccx ze -
There are many temp cache file for moodle system like "F:\MoodleWindowsInstaller-latest-1.9.5\server\tmp\a\1\eaccelerator-a1bd19aa75188c18f25ae95ae526a10a".
You can delete all of this files then restart apache server to solve this problem.
In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Leo Firebrand -

I had the same problem. let me ask you, when you installed moodle did you use the automated install for window where it setup xamp and everything for you. If so then you likely have the problem I did.

For whatever reason the windows installer version does not function right when it comes to checking for changes to themes. follow the step here to install Xamp manually and then moodle. It's not that bad really.

http://docs.moodle.org/en/Windows_installation_using_XAMPP

If you want to retain your existing moodle setup and data, stop at the create the mysql database section and do the following

  1. Move your existing moodle folder to c:\xamp\htdocs\moodle.
  2. Move your existing moodledata folder to C:\xamp.
  3. Copy your existing mysql folder to C:\xamp and say yes to overwrite files.
  4. Navigate to htdocs\moodle and Open config.php with wordpad.
  5. set cfg->wwwroot to 'http://<yourIP>/moodle'
  6. set cfg->dirroot to 'C:\xampp\htdocs\moodle'
  7. set cfg->dataroot to 'C:\xampp\moodledata'

This whole process took me 15-20mins. so its not bad. Once I started moodle up again and tried to make changes to the themes, a simple refresh of the web browser was all I needed to see changes. Hope this helps.

In reply to Leo Firebrand

Re: Can't update/modify themes....Why?

by morgan routledge -
Yes, I did the windows install using xamp. This looks like it will do the job. thanks a lot.
In reply to Leo Firebrand

Re: Can't update/modify themes....Why?

by rose bally -

Hi,
Leo Firebrand

Thank you very much - I appreciate all your help.

But I have a problem when i start the control panel
Apache and FileZilla is starting but Mysql is not starting
It is showing error like

Cannot connect: invalid settings.

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.





In reply to Leo Firebrand

Re: Can't update/modify themes....Why?

by rose bally -

Please help me.............!


I had followed the above steps to transfer the moodle but when i try to open the moodle it is showing the following error!


Error: Database connection failed.

It is possible that the database is overloaded or otherwise not running properly.

The site administrator should also check that the database details have been correctly specified in config.php

In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Stuart Chapman -
We had this issue and the cause was the eAccelerator PHP extension. Over simplified, this extension caches the PHP files when they are executed, resulting in a performance boost when the files are executed again. As any style sheets you create are joined by a Moodle PHP file, the output was not updating after the first run.

You can turn off eAccelerator by editing the php.ini file and adding a semi-colon (to comment out the line) to the beginning of any lines referencing this extension - the applicable lines should be very near the bottom of the configuration.

This will, obviously, stop any pages benefiting from the performance increase of using this extension so you probably only want to do this on development sites.
In reply to Stuart Chapman

your solution worked perfectly for me.

by Garrett Reynolds -
Hi - your solution worked perfectly for me. Thank you so much.
In reply to Garrett Reynolds

Re: your solution worked perfectly for me.

by rose bally -


Hi,

Thanks for your response!

Can you please give me simple steps to transfer the entire
Xampp folder from one system to another...............!

Please help me .......Waiting for your response.

Thanks Regards
Rose Bally
In reply to rose bally

Re: your solution worked perfectly for me.

by David Wallace -
@Stuart

If I ever meet you, I not only owe you a beer, but I'll get you blind drunk for free mate.

After two solid days of ploughing through re-installs of both repo moodle-r2, and packaged moodle installs, after downgrading a xampp from php 5.3 to php 5.2, after reverting to wamp as a last resort, and then back to xampp the next day, after altering file paths, checking my regedit listings, screaming at Firefox, screaming at other developers...

You nailed it.

eaccelerator.enable = "0"

Again, thankyou so much, and also thanks to everyone else for your suggestions.
Attachment beer.jpg
In reply to Tony Dopun

Re: Can't update/modify themes....Why?

by Christine Wolf -

Hi,

what helped me was navigating to APPEARANCE -> THEMES -> THEME SETTINGS:

and setting theme designer mode to "Yes":

-----------------------------------------------------------------------------------------------------------------------

Theme designer mode themedesignermode
Default: No

Normally all theme images and style sheets are cached in browsers and on the server for a very long time, for performance. If you are designing themes or developing code then you probably want to turn this mode on so that you are not served cached versions. Warning: this will make your site slower for all users! Alternatively, you can also reset the theme caches manually from the Theme selection page.

--------------------------------------------------------------------------------------------------------------------------

 

In reply to Christine Wolf

Re: Can't update/modify themes....Why?

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

That would have be a correct answer had this been about Moodle 2.0+ but it wasn't it was about Moodle 1.9. The actual problem was a PHP extension. You can read all about how to fix that bug in this Moodle document Themes FAQ#How can I see theme changes when using the Windows Complete Installer package

However, in Moodle 2.0+ we use Theme Designer Mode like you said, but the eaccelerator PHP extension is still a problem for some systems.

Glad it helped you

Cheers

Mary