I understand that the new standard theme in Moodle 1.5 on purpose makes unstyled areas green to alert developers to the fact that work is required. Unfortunately I don't know what exactly needs to be done to get rid of them. So why do the boxes on mod/quiz/edit.php show up green but boxes on other pages don't. They all are printed with the function in weblib.php and thus have class="generalboxcontent".
Re: Green areas in Moodle 1.5 standard theme
if I'm not wrong green areas show uses of the $THEME global that, if I'm not wrong (again), must me completely out for 1.5.
Ciao
Hi,
it's looking quit ugly, isn't it ?
yep, the signal means the code should be rewritten without using "$THEME->".
Another way to get fast results would be to change the functions in weblib.php to simply not use the color information and not write them into the html page.
Urs
Ah, thanks. Indeed I had not noticed that $THEME was used on those pages. I think that it is good that such things show up as green in the development version.
I'll remove the use of $THEME from the quiz module. Should I give every box I print with print_simple_box() its own class and if so, what naming convention should I use? I probably should look for that information in the Reforming the CSS section in the Developer Wiki but I am not sure the information there is up-to-date.
Can you imagine to lable the page areas with names standing for their task? For example on "quiz/edit.php" the three areas could be named "questions", "categories" and "new-questions". The CLASSes for the table of the left area would be:
<table class="generalbox questions" ...
<tr>
<td class="generalboxcontent"> (without the bgcolor tag)
...
With the list of CLASSes for the table we can
- either generally address all elements on the page called "generalbox"
- or with the second CLASS "quizzes" the left box individually and not the others on the page
I hope I could help you.
Urs
For the time being I have only taken out the references to $THEME from quiz module pages. In the long run there should of course be some id and class attributes to allow style sheet designers to do their stuff. But because I have never designed a style sheet I have no idea what elements should get their own id or class. I think page authors need some guidance.
I don't think the tables in the developer wiki listing all the classes that have been defined on the various pages are so important, after all this information can always be obtained from the page source or, much more conveniently, by viewing a page in firefox with the web developer toolbar. But some guidelines on how generous we should be with sprinkling class attributes around the page would be very helpful.
You write "I don't think the tables in the developer wiki listing all the classes that have been defined on the various pages are so important, after all this information can always be obtained from the page source or, much more conveniently, by viewing a page in firefox with the web developer toolbar."
Do you think a consistent naming scheme will be possible without a root, where everybody can access the information and choose the same names? I'm not shure if looking at the code or the pages with firefox will suffice.
You write "I think page authors need some guidance."
What guidance would you prefer to have? Some informations I can think off could be:
- Documented page examples?
- Explanations how CSS influences the look of some Moodle pages?
- Guidelines for the page design with the needed IDs and CLASSes?
What I meant was that an exhaustive list of all the classes on all the pages was not necessary. If this is listed for some example pages then that is enough to illustrate the naming scheme.
Your third bullet point I believe is the most important. When I build Moodle pages I often use functions from weblib to create certain page elements. print_table() and print_simple_box() are two examples. I would like guidance on whether these should in future be called with class names. In most cases I personally don't see any need to restyle the elements but perhaps the possibility should nevertheless be provided?
The quiz module edit.php page is a good example. I certainly will always want all those boxes to have the same style. But perhaps someone else likes things colourful and wants to give a different colour to each of them. Should we cater for such things?
I remember vaguely reading in these forums that tables don't need class names unless there are several on one page because the page id can be used instead. That makes sense to me but I would probably not have realized this if I had not read it here. This is the kind of guidance that I need.
Well, let's start.
Couldn't we make a deal You add parameters to the functions print_table()
and print_simple_box()
to transmit CLASSes and IDs and I will start building an illustrated guide and use the quiz/edit.php page as an example. This guide should show the tasks of the used CLASSes and IDs and some examples of their uses.
With the CLASS names for the three tables on the quiz/edit.php page not only those areas could be colored differntly - I wouldn't like this way of usage either - but text design of one block could be changed, to make it for example the dominant information on the page. One could change text alignment in another area from center to left. With the CSS "Contextuel Selectors" you could address the headline of one special area and change only it's color - this would be hard work with firefox's dom inspector to target this headline and would have to be changed with every change in the page structure.
What do you think?
Your proposal would sound good if it were not for the fact that I feel completely incompetent because I know virtually nothing about CSS. I think the way forward would be for YOU to give one example page all the ids and classes that you think it should have and then to explain this page. THEN I and other developers could follow your model.
Sorry if my posting was ambiguous. I wanted to ask you for one or two additional parameter/s for the two functions print_table()
and print_simple_box()
to hand CLASSes and an ID over to the table and the box. I don't dare to change such complex functions.
I'll work on an example page.
By the way - I saw you started a quiz section in the developer wiki. I wish you will be able to attract everybody involved in Moodle quiz development to participate working on the wiki.
css-discuss uses their wiki as a repository to collect the results of the discussion in their forum. Perhaps this is one way to successfully work with wikis.
Ah, I didn't read your post carefully. The print_simple_box() function already has a class argument but print_table() does not and neither has an id argument. I guess every function in weblib.php that prints standard webpage parts should have optional arguments to pass class and id. I would be happy to take a look at it but it would most likely have to wait until tomorrow night. So if anyone else cares to do this earlier...
And yes, I think using the wiki for summarizing discussions is a good idea and we developers should make more use of the developer wiki.
That is great, thank you.
Edit: just noticed previous posts and added ID as well.
"What guidance would you prefer to have? Some informations I can think off could be:
- Documented page examples?
- Explanations how CSS influences the look of some Moodle pages?
- Guidelines for the page design with the needed IDs and CLASSes?"
That would be a really great help for everyday users of Moodle as well.
WP1