Forums | Mahara Community
Customizing Theme etc.
09 December 2008, 13:51
Hey! I got it up and running on a different host. Apparently the other host didn't take too kindly to it. I flew threw the installation process like a breeze.
Now I'm customizing the theme. I was hoping that you could give me the path to edit the main logged out home and the main logged in home.
What do I need to do to change the main navbar? (Home, Profile, My Portfolio, etc) Where is the path to that file?
I think that's all I need right now. I would like to be able to add a handful of other pages that would be accessible from the logged out page, as well as the logged in page on the main menu navbar. I would also like to expand the green part of the menu accross the page for aesthetics.
You can see what I've done so far.
I think I can do it fi I know where the files are.
Thanks so much!
09 December 2008, 15:52
You can edit the content of the logged out and logged in homepage in the 'Edit Site Pages' section in the administration section. You edit their colour scheme by editing the header template.
The main navigation menu items are defined in code. Do you just want to change the look of it?
The best way to do that is to create a new theme, based off the default theme. Note that you don't want to go editing the default theme, otherwise when we make tweaks to it you'll have a hard time merging them.
You do this by making a new directory in the theme/ directory, copying the config.php from the default theme to the new directory, and editing it to change $theme->name and add a line: $theme->parent = 'default';. After that, go to Site Options, change the theme, then log out and in again. You'll then be using the new theme which will look just like the default for now.
Then you copy files from the default theme to the new theme, keeping the directory structure the same, only when you need to make changes to them. E.g. the header is in the file theme/default/templates/header.tpl. To change it in your theme, you should copy it to theme/yourtheme/templates/header.tpl, and make your changes there.
The templates/header.tpl file will be of interest to you. You might also want to separately make theme/yourtheme/static/style/style.css, as this will be included on the page (and will apply after the default theme's CSS). You can tweak the CSS that way.
Hope that helps
09 December 2008, 19:40
Actually, I just wanted the ability to add pages to the site, and pages to the menu.
ie, About us, Donate, etc.
I want logged out users to have a menu that they can use to view these pages.
I looked at header.tpl
With my limited php skills, I only understand most of it.
I don't see where I can edit any menu items unless it's on the admin menu.
Do you have any suggestions?
It would be perfect if I could just add more pages
09 December 2008, 20:36
Look in lib/web.php, at the main_nav function. That's where the menu items in the top tabs are defined.
The menu items at the bottom of the page are in templates/footer.tpl
09 December 2008, 23:17
Thanks. That helped alot. I was able to change the menu.
You can see what I've done by going to youthforprogress.org/new/ and loging in with
Look at the menu.
Which file should I edit to extend the blue menu background accross the screen, just as the submenu is?
It would help incredibly with my design
How do I add pages so that I can edit them?
And is it possible to change the code on the home page to incorporate the basic menu onto it?
Would it be a big project to make the logo work at 150 px tall without screwing up the menu?
10 December 2008, 0:21
When I visit your link I get redirected to http://www.yipiraq.org/ which is a wordpress, there's no login box.
Adding pages - Mahara wasn't designed as a CMS so it isn't as easy to add pages as in something like drupal, but you can do it. Look at the source code for terms.php or about.php and basically copy those files to your new page location and change the appropriate bits inside them. You should be able to get a new 'site page' without too much trouble.
The menus only appear when you're logged in because that's the only time they make sense. You'd have to modify the smarty() function in lib/web.php to add menu items to the logged out homepage probably.
I think to make the image bigger you'd also need to style a bit of css to move the menus around. If you can use firebug, then you can probably work out what needs to change. Otherwise, you might have to play it safe for now and stick with the default size.
10 December 2008, 0:52
I'm sorry about that. I'm managing way too many websites here.
Mahara isn't designed as a CMS, I know, but it would be cool if you could give future versions an easier way to add a few pages. But it won't matter that much for me, since I already have it.
I'll take a look at it.
I would like to know how to get the menu bg to extend all the way to the right like the submenu does.
but is there a way to say, move the login box around or something?
I took terms.php, copied and renamed it page1.php.
Within the file, it says:
$smarty = smarty();
If I change termsandconditions to page1, then it looks like this:
Obviously, the string isn't defined. Within which file do I define it?
10 December 2008, 16:27
Yes it would be cool if extra pages could be added - we thought that maybe if they could be added as views that would be useful.
To make the menu background extend you'd have to use similar CSS rules to the sub menu, it shouldn't be too hard. Just have a look in the style.css file and see what the submenu does. I think it puts the background image either on the div containing the submenu or the ul.
The login box is on the right with the other sideboxes, we haven't made that configurable yet. You could move it up and down in the column if you had more than one box for people logged out though.
Regarding the new page - the string [[page1/mahara]] corresponds to $string['page1'] in lang/en.utf8/mahara.php, but that's only the name of the page, not its content.
I think you might have to insert a row into the site_content table in the database to get the page content set up - have a look at that table and insert a row for it. Then, you should be able to edit the content using the 'Edit Site Pages' page of the administration section.
28 April 2009, 15:44What about disabling a page? I did not see a place to do that, but I do like the ability to add your own text.
28 April 2009, 17:35Disabling a page isn't possible yet (short of removing the PHP script and updating the navigation), but yeah it would be a good idea