2016-01-11 00:38:54 |
Aaron Wells |
description |
As discussed in the Mahara dev meeting. With the new bootstrap themes, Mahara core blocktypes now use fontawesome for their icons. Consequently the template that displays each block in the block picker, is no longer using the old thumb.png or get_icon() mtehods to get the block's icon and display it. Instead, it just has a <span> with a class "icon-{blocktype.name}":
https://git.mahara.org/mahara/mahara/blob/master/htdocs/theme/raw/templates/view/blocktypelist.tpl
These are then mapped to fontawesome classes here:
https://git.mahara.org/mahara/mahara/blob/master/htdocs/theme/raw/sass/typography/_icons.scss#L21
It would make sense for us to support the old methods, and we could make the system do this automatically, with some logic in blocktypelist.tpl and/or in htdocs/blocktype/lib.php
For now, the workaround is to create a style.css file for the block (under the block's own theme directory) and define the class in there, like this example from the clippy block: https://github.com/agwells/maharacontrib-blocktype-clippy/blob/master/theme/raw/static/style/style.css
.icon-clippy::before {
content: url(\../images/thumb.png);
} |
As discussed in the Mahara dev meeting. With the new bootstrap themes, Mahara core blocktypes now use fontawesome for their icons. Consequently the template that displays each block in the block picker, is no longer using the old thumb.png or get_icon() mtehods to get the block's icon and display it. Instead, it just has a <span> with a class "icon-{blocktype.name}":
https://git.mahara.org/mahara/mahara/blob/master/htdocs/theme/raw/templates/view/blocktypelist.tpl
These are then mapped to fontawesome classes here:
https://git.mahara.org/mahara/mahara/blob/master/htdocs/theme/raw/sass/typography/_icons.scss#L21
It would make sense for us to support the old methods, and we could make the system do this automatically, with some logic in blocktypelist.tpl and/or in htdocs/blocktype/lib.php |
|