Forums | Mahara Themes

General discussion /
Can I add some functionality to theme?


anonymous profile picture
Account deleted
Posts: 4

24 April 2012, 21:57

I want to add some functionality to mahara theme, but it should be dependent to that theme only, is it possible to create some functionality to particular theme.

if you know the answer please share it in forum.

Kristina Hoeppner's profile picture
Posts: 4736

24 April 2012, 22:39

Hello Suman,

Each Mahara theme has its own folder in the theme directory. Thus, if your changes can be made in there and are of CSS nature etc. you should be able to.

Cheers

Kristina

anonymous profile picture
Account deleted
Posts: 4

24 April 2012, 23:44

Thank you ver  much for the reply Kristina..:)

Yeah each theme has its own folder, and the css kind of changes can be done into particular theme.

But my main point is that can we add the additional feature by using php into particular theme.

Supposed there we can use different pieforme for different theme, like this, is there any way to add new php functionality into the theme.

Ofourse I don't want to go through out the theme.

 

Kristina Hoeppner's profile picture
Posts: 4736

26 April 2012, 3:37

Hello Suman,

Sorry, I can't help you further as I am not a developer. I hope somebody else can assist you.

Cheers

Kristina

anonymous profile picture
Account deleted
Posts: 8

26 April 2012, 5:18

Hi Suman,

I'm not a developer either but i have made a few PHP tweaks in some themes. For this reason I might cover some things you consider to be very basic and quite patronising, but I'm just sharing my own experiences here and don't want anyone to make the same mistakes I did Wink.

The first thing you need to do is identify which template (.tpl) file is appropriate for your changes, in the Raw theme, as any given page in Mahara is constructed using these templates. When you've found the right file (trial and error mostly) then you need to decide whether to apply the change to *your* theme or *all* themes. This is only important if you allow users to select themes for their pages, which we do on our implementaion. If it's for all themes then edit the .tpl file in the Raw theme (all other themes defer to Raw, just like CSS); a safe precaution is to duplicate the .tpl file and add ".old" to the filename, in case you messs up. If it's for your theme only then copy the .tpl file into your theme, using the same directory structure as found in Raw, and edit the file there.

A couple of examples:

  1. Adding google analytics code to all pages involves adding the code to the footer.tpl file in the Raw theme, and also microfooter.tpl if you have "use small headers" enabled in your site config.
  2. Adding extra containing divs (in my case to allow for cross-browser rounded corners) would mean copying the .tpl file into your theme and edting it there. When doing this kind of tweak bear in mind that the page display view and the page editing view use different templates for blocktypes (if I'm remembering correctly).

I believe there may also be some .tpl files outside of the themes but I could be wrong, and the Raw theme covers the majority of my requirements, and so hopefully yours too. I hope this helps, and that I've explained things sufficiently and correctly. Feel free to ask any further questions and I'll try to reply if I know the answer. Happy coding!

anonymous profile picture
Account deleted
Posts: 8

26 April 2012, 5:43

Sorry, I should add that you might get a better reply than mine if you post your question in the Mahara Themes group forum.  < silly me. I should really check which forum I'm in *before* posting. Embarassed

anonymous profile picture
Account deleted
Posts: 4

27 April 2012, 22:10

Hey steve...nice to share your experience on this forum, your idea is good when we override the structure(html part) in our theme for achieve new look.

But I was talking about to add new php functionality in our theme..:)

 I have the question for all mahara guys...

There is a new feature (configurable theme) add  into mahara150, on which we do customize the design(eg:- background color, navigation color etc) but this feature would applied into institution only which means we can customize the different design of theme for particular institute.

But that kind of changes would not be applied for whole site, Is there any way to achieve that feature into our theme that through it we can customize the design for our whole mahara site but institute only.

28 April 2012, 17:27

Hello,

To change the whole site design you can create your own theme. You will find instruction on how to do this here (https://wiki.mahara.org/index.php/Customising/Themes). What you need is a little experience in CSS, html and a pinch of php.

Changing the whole site presentation is different than giving institution admin the way of customizing part of the template to adapt the site to their corporate or "institution" rules. This explain, maybe, why configurable theme is only for institution. Which makes sense to me.

Regards,

-dajan

anonymous profile picture
Account deleted
Posts: 4

29 April 2012, 10:20

Yeah you are right Dominique-Alain JAN..:, But what we will do if the admin of mahara want to change the presentation of whole mahara site. Is not it good... if we can give the setting page to admin user for control the presentation of whole mahara site.

Ofcourse the life of admin will be joyous...:) because of that setting page(feature) on his or her theme.

9 results