How I did this:
Made a custom function called 'pub_nav' and placed it below the existing 'main_nav' function within the web.php page.
Code here:
function pub_nav() {
$menu = array(
array(
'path' => '',
'url' => '',
'title' => get_string('home'),
'weight' => 10,
),
array(
'path' => '',
'url' => 'about.php',
'title' => get_string('about'),
'weight' => 20,
),
array(
'path' => '',
'url' => 'news.php',
'title' => get_string('news'),
'weight' => 30,
),
array(
'path' => '',
'url' => 'colleges.php',
'title' => get_string('colleges'),
'weight' => 40,
),
array(
'path' => '',
'url' => 'industry.php',
'title' => get_string('industry'),
'weight' => 50,
),
array(
'path' => '',
'url' => 'contact.php',
'title' => get_string('contact'),
'weight' => 60,
),
);
return $menu;
}
Then I the placed the following line into line 374 on the web.php file so that the 'pub_nav' function will be called when it senses the user isn't logged in.
Code Here:
$smarty->assign('PUBNAV', pub_nav());
Next I modified the header.tpl file. In the code below, the bold parts are the code that I added. You will see that I copied the $MAINNAV section and replaced the MAIN part with PUB. Then I placed both sections into a IF/ELSE statement for when somebody is carrying the $LOGGEDIN variable it will choose the $MAINNAV section of code and when they aren't it will default to the $PUBNAV section of code.
Code Here:
{if $LOGGEDIN}
{if $MAINNAV}
<div id="mainnav">
<ul>
{foreach from=$MAINNAV item=item}
{if $item.selected}{assign var=MAINNAVSELECTED value=$item}<li class="selected"><a href="{$WWWROOT}{$item.url|escape}">{$item.title|escape}</a></li>{else}<li><a href="{$WWWROOT}{$item.url|escape}">{$item.title|escape}</a></li>{/if}{/foreach}{if $LOGGEDIN}{if $USER->get('admin') || $USER->is_institutional_admin()}{if $ADMIN || $INSTITUTIONALADMIN}<li><a href="{$WWWROOT}">{str tag="returntosite"}</a></li>{elseif $USER->get('admin')}<li><a href="{$WWWROOT}admin/">{str tag="siteadministration"}</a></li>{else}<li><a href="{$WWWROOT}admin/users/search.php">{str tag="useradministration"}</a></li>{/if}{* <li><a href="" onclick="createLoggingPane(); return false;">Create Logging Pane</a></li> *}{/if}<li><a href="{$WWWROOT}?logout">{str tag="logout"}</a></li>{/if}
</ul>
</div>
</div>
<div id="subnav">
{if $MAINNAVSELECTED.submenu}
<ul>
{foreach from=$MAINNAVSELECTED.submenu item=item}<li{if $item.selected} class="selected"{/if}><a href="{$WWWROOT}{$item.url|escape}">{$item.title|escape}</a></li>{/foreach}
</ul>
{/if}
{/if}
</div>
{else}
{if $PUBNAV}
<div id="mainnav">
<ul>
{foreach from=$PUBNAV item=item}
{if $item.selected}{assign var=PUBNAVSELECTED value=$item}<li class="selected"><a href="{$WWWROOT}{$item.url|escape}">{$item.title|escape}</a></li>{else}<li><a href="{$WWWROOT}{$item.url|escape}">{$item.title|escape}</a></li>{/if}{/foreach}{if $LOGGEDIN}{if $USER->get('admin') || $USER->is_institutional_admin()}{if $ADMIN || $INSTITUTIONALADMIN}<li><a href="{$WWWROOT}">{str tag="returntosite"}</a></li>{elseif $USER->get('admin')}<li><a href="{$WWWROOT}admin/">{str tag="siteadministration"}</a></li>{else}<li><a href="{$WWWROOT}admin/users/search.php">{str tag="useradministration"}</a></li>{/if}{* <li><a href="" onclick="createLoggingPane(); return false;">Create Logging Pane</a></li> *}{/if}<li><a href="{$WWWROOT}?logout">{str tag="logout"}</a></li>{/if}
</ul>
</div>
</div>
<div id="subnav">
{if $PUBNAVSELECTED.submenu}
<ul>
{foreach from=$PUBNAVSELECTED.submenu item=item}<li{if $item.selected} class="selected"{/if}><a href="{$WWWROOT}{$item.url|escape}">{$item.title|escape}</a></li>{/foreach}
</ul>
{/if}
{/if}
</div>
{/if }
If anybody has an insight that would fix this problem it would be greatly appreciated.
--
David Varney
Celeritas Interactive Media
Celeritasdesign.com
--
David Varney
Celeritas Interactive Media
Celeritasdesign.com
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.
youthforeducation.org/new/
alisa
login1
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();
$smarty->assign('page_content', get_site_page_content('termsandconditions'));
$smarty->assign('searchform', searchform());
$smarty->display('sitepage.tpl');
If I change termsandconditions to page1, then it looks like this:
http://youthforeducation.org/new/page1.php
Obviously, the string isn't defined. Within which file do I define it?
]]>
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.
]]>
You can see what I've done by going to youthforprogress.org/new/ and loging in with
user: alisa
pass: login1
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?
Thanks
JP
The menu items at the bottom of the page are in templates/footer.tpl
]]>ie, About us, Donate, etc.
AND
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
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
]]>
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.
www.youthforeducation.org/new/
I think I can do it fi I know where the files are.
Thanks so much!