Hi everybody.
Having used Wordpress for several years, I only tried elgg for a couple of days and I really love all the features in the box.
If I found very easy to set the features and rules according to my wishes, I really struggle to change the look and feel and it seems that they are no theme plugins working with the latest version of elgg.
Therefore I'm ok to write my own plugin to create a theme that could change the apparence of my site.
But I must admit that, after spending a whole day trying to understand the documentation, I didn't succeed.
I would be happy if I could, as a start, put custom colors in a .css file.
I followed the steps described in the developer guide :
Could somebody tell me what I did wrong and give me an example of the content of a very simple elgg-plugin.php ?
Thank you very much.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
Where my_theme/my_style.css is a file located at In this file I made custom changes for elgg-layout-columns class. After clicking 'Upgrade' button via administration Dashboard you'll see the changes on your site. Another way is overriding views. In the example mentioned above, you just need to copy to your custom plugin:
In case you want to override global variables, you need to use vars:compiler, css hook in your plugin. We use our elgg-plugin.php again: Where, \MyPlugin\Theme\Styles is your class located at In \MyPlugin\Theme\Styles.php: I hope you've some developer experience otherwise this will take a long time here ;) Learn Plugin section to use elgg-plugin.php. I also recommend that you dig into someone else's code to get examples from there. Good point start is ColdTrick's repos. We also have Telegram channel @elggnews and group @elggchat
- Tweenkle@Tweenkle
Tweenkle - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
You must log in to post replies.The easiest way is to extend existing styles.
Most of Elgg styles are in this folder:
Here is what you can do.
For example, I need to change the layout page.
I use Dev tools in my browser for this.
Then I find the desired class (e.g. .elgg-layout-columns ) and find out that it's in this file:
Now I can change this class through the view extension.
This can be done using elgg-plugin.php in my custom plugin:
Now make changes there.
You don't need to add anything to elgg-plugin.php in this case.
Note:
When using the styles extension, you can simply replace the styles in the class you need.
But if you're using view overrides then you need to save the entire structure of the file by making edits to it.
Regarding colors, please see engine/theme.php
You can use something else in your custom CSS:
Dear Nikolai,
Many thanks for your message and the links you provided.
This was really helpful and after several attempts, I finally succeed with the extend method.
I have another question :
How can I replace the text logo by an image logo ?
Thanks again.
Have a nice day.
Thierry
The links below are for previous Elgg versions but should work for the current release as well:
https://elgg.org/discussion/view/2804746/logo-in-default-theme-in-all-stable-elgg-version
https://elgg.org/discussion/view/2849336/how-to-change-the-logo-from-text-to-image
I forgot to mention that the easiest way to extend engine/theme.php is to use a hook in elgg_plugin.php instead of class: