I think this nice Chameleon theme (and it's marvin css which I love) really misses "mission" box for a front page. Can somebody tell me how to implement it? I spent half a day but no result. Lack of programming skils.

Thanks

Comments

orzenil’s picture

hello,

try coding follow xtemplate lines. I think it could work:

- in chameleon.theme:

at chameleon_settings hook add just before return $output :

$group = form_textarea(t('Message on front page'), 'chameleon_mission', variable_get('chameleon_mission', 'edit mission'), 70, 6, t('This text will be displayed on the front page. It can be used to display a mission statement, announcement or site description..'));

$output .= form_group(t('Header settings'), $group);

at chameleon_page hook add just after < id=\"main\" >;

// only parse the mission block if we are on the frontpage ...
if ($_GET["q"] == variable_get("site_frontpage", "node") && ($mission = variable_get("chameleon_mission", "edit mission")))
{
$output .= "

$mission

\n";
}

that's enough in chameleon.theme

Now take your chameleon.css in the marvin chameleon directory and add you stylesheet to mission. As an example:

#mission {
border: solid 1px #777;
background-color: #fff;
padding: 1.5em 2em;
color: #000;
}
#mission a, #mission a:visited {
color: #9cf;
font-weight: bold;
}

Good look. If you want contact me ( orzenil.jr at intertexto.net ) and I'll send a patch with these modifications

Orzenil

soupp’s picture

Thank you for guidelines. It works perfectly. But still strange why xtemplate and your example do not use mission from main admin/config but their own code.

And I think div's/class around $output .= ... $mission have been striped by drupal. So I added them.

Thanks again

PS How to post unstriped code if forums?

dries’s picture

Maybe file a feature request?

hruodland’s picture

The suggestion worked perfectly with 4.4.2 but doesn't seem applicable now themes have been reworked. Can anybody suggest how to do it now? (I know next to nothing about php.)

Thanks for any help!

carlmcdade’s picture

I modified the chameleon template to show the mission statment on the front page only. I also use just the style.css rather than both the common.css and style.css for simplicity. You can see the result here http://www.hivemindz.com/site . If you want the files I'll upload them somewhere. I also commented the PHP as much as possible to make it easier to find things on the theme page.
---------------------------
info for Drupal installation
__________________________
Carl McDade
Information Technology Consult
Team Macromedia
www.heroforhire.net

carlmcdade’s picture

Is there a hack site somewhere or should I contribute here?.
---------------------------
info for Drupal installation
__________________________
Carl McDade
Information Technology Consult
Team Macromedia
www.heroforhire.net

hruodland’s picture

Most people seem to put shortish snippets of code (inserts to modules or whatever) in their posts here and longer pieces of code in posts on their own sites, to which they then link from here. Anyway, I'd like to see how you did it, however it's convenient for you to make it available.

(By the way, under Firefox 1.0PR running on Win98SE there's a formatting problem with your mission statement. The image seems to push the text off to the right, so not all of it appears on screen.)

carlmcdade’s picture

http://www.hivemindz.com/site/themes/chameleon/chameleon.zip

I design in Firefox PR 1.0 on Xp. Nothing seems out of place. What resolution are you using?

---------------------------
info for Drupal installation
__________________________
Carl McDade
Information Technology Consult
Team Macromedia
www.heroforhire.net

hruodland’s picture

Worked like a charm. Thanks!

To boil down what I got from your files:

1. In chameleon.theme, in the array of toggles at the beginning, I stuck in "'toggle_mission'," .

2. Right before "if ($title = drupal_get_title()) {" I stuck in:

if ($_GET['q']=="node"){
if ($mission = theme_get_setting('mission')) {
$output .= "<div id=\"mission-statement\">".$mission."</div>";
$output .= "<div id=\"main-content\">";
}
}

3. Then I added what worked for me for "mission-statement" in style.css.

On the browser point, I'm using 800x600.

freyquency’s picture

first, those periods before and after $mission, um, they didn't work for me. otherwise it works. thanks for the info.

on my theme/engine i'm developing from chameleon i used spaced css tags, eg- 'story entry', 'page entry', 'event entry'. so when i did the mission statement i used 'mission entry' so it appears at the top of the content area and it has a style it defaults to if none is specifically created for the 'mission' part of 'mission entry'. just a nice shorthand for css.

joachim’s picture

Just in case anyone like me finds this thread looking to add the mission statement to chameleon on 4.7, here's how I just did it:

Line 9:
add 'toggle_mission' to the list of features.

Line 77:

  $output .= "   <td id=\"main\">\n";
  
  // mission statement, joachim's hack
  if (theme_get_setting('toggle_mission') 
      && $_GET["q"] == variable_get("site_frontpage", "node")) {
    $output .= "  <div class=\"site-mission\">". variable_get('site_mission', '') ."</div>";  
  }  
  // hack ends 

Then add something to the stylesheet for the 'site-mission' class.

smither’s picture

I could not get my site mission statememt to appear in 5.X either. As an experiment, I added:

$output .= "  <div class=\"site-mission\">". variable_get('site_mission', '') ."</div>";

right before the:

$output .= "</div>\n";

that ends the:

$output .= " <div id=\"header\">";

header div in the chameleon.theme file.

After making this change, my Mission Statement shows up in the header section!