Hi,
I try to create a Subtheme of Mayo and i have a lot of problem.
I try to override theme functions and it doesn't work.
In file template.php in my subtheme (name station) i declare

function station_build_columns($columns) {
  $styles = array();
  $num_columns = 0;
  $first = -1;

  for ($i = 0 ; $i < 4 ; $i++) {
    if ($columns[$i]) {
      if ($first == -1) $first = $i;
      $last = $i;
      $num_columns++;
    }
  }
  if (!$num_columns) return '';

  $out = '';
  $out .= '<div class="column-blocks2 clearfix">';
....

But this code is never execute.
However, i try override

function mayo_page_alter($page) {
  // Add meta tag for viewport, for easier responsive theme design.
  $viewport = array(
    '#type' => 'html_tag',
    '#tag' => 'meta',
    '#attributes' => array(
      'name' => 'viewport',
      'content' => 'width=device-width, initial-scale=1',
    ),
  );
  drupal_add_html_head($viewport, "viewport");
}

Like this

function station_page_alter($page) {
  // Add meta tag for viewport, for easier responsive theme design.
  $viewport = array(
    '#type' => 'html_tag',
    '#tag' => 'meta',
    '#attributes' => array(
      'name' => 'viewport2',
      'content' => 'width=device-width, initial-scale=1',
    ),
  );
  drupal_add_html_head($viewport, "viewport2");
}

And i have 2 meta tag viewport and viewport2.
I don't understand how i can override a function.

A other problem, i have this message in adminstrator page of the subtheme.

Notice : Array to string conversion dans mayo_get_plugins() (ligne 34 dans C:\wamp\www\station_bo\sites\all\themes\mayo\inc\plugins.inc).

Thanks

CommentFileSizeAuthor
#17 mayo_sitestaz.zip100.89 KBXTaz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lbernard’s picture

Assigned: lbernard » Unassigned
mermentau’s picture

Category: Bug report » Support request
Priority: Critical » Normal

I changed the Category to "Support request" since the Mayo theme works fine and you need help with a sub-theme. The problem is that it's hard to help on that as we don't have access to your sub-theme code. Did you see this documentation for making a sub-theme for Mayo? Have you been through all the other documentation on drupal.org concerning making sub-themes?

lbernard’s picture

I saw the documentation for making sub-theme for Drupal and for Mayo.
I just create a directory name "station" (my subtheme).
I copied directory "colors".
I created the file station.info

name = Station
description = SubTheme of MAYO created by KALAN Informatique
core = 7.x
base theme = mayo


stylesheets[all][] = css/style.css
stylesheets[all][] = css/colors.css


regions[header] = Header
regions[help] = Help
regions[page_top] = Page top
regions[page_bottom] = Page bottom
....

I created directory css with 2 files : style.css and colors.css (no change for the moment).
And i have the message in administrator page of sub-theme

Notice : Array to string conversion dans mayo_get_plugins() (ligne 34 dans C:\wamp\www\station_bo\sites\all\themes\mayo\inc\plugins.inc).

After i added a new file template.php with the 2 functions station_build_columns and station_page_alter with the problem (see first comment).
Thanks

veskimees’s picture

It seems that I have a similar problem -- subtheme css doesn't have any effect.
I updated my page lately and made subtheme (yes, I read all instructions).

name = SV
description = MAYO derivate for site (test.)veskimees.eu
core = 7.x
base theme = mayo

stylesheets[all][] = css/style.css
stylesheets[all][] = css/colors.css
stylesheets[all][] = css/sv.css

regions[header] = Header
regions[help] = Help
regions[page_top] = Page top
regions[page_bottom] = Page bottom
etc etc

Something is wrong because I tried everything in sv.css (even #page-title {color: red !important;} ;-) ) and simply nothing.
I will humbly appreciate any hint and of course I will gladly give any further information.

mermentau’s picture

Could you make a quick sub-theme with Bartik and see if you have the same problems?

veskimees’s picture

Just did, it works fine (test.veskimees.eu is ugly red :-)).

mermentau’s picture

I emailed you through your contact link here.

veskimees’s picture

OK, sorry, I just put theme back one more time and It works...
Why... I really don't know. It seams that my post is irrelevant now, but there are something...
(I made Bartik subtheme, made that default and only made my mayo subtheme default again -- and It works... Maybe Bartik subtheme wrote something somewhere... I realize it sound little bit scholastic, but that mayo subtheme was first I ever made on that site...)
Sorry again to waste your time and thanks for reply. (But I - honestly! - really had a problem! ;-) )

veskimees’s picture

Just maybe it helps somebody: I made same things with my live site:
Mayo subtheme didn't work.
I made Bartik subtheme, set it default and then set my mayo subtheme default again and it works.
Mystic...

mermentau’s picture

Status: Active » Fixed

Good to hear it's working. Thanks for the follow up.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

XTaz’s picture

Status: Closed (fixed) » Active

Hi
Same error for me
Notice : Array to string conversion dans mayo_get_plugins() (ligne 34 dans T:\....\sites\all\themes\mayo\inc\plugins.inc).

i have just create a new sub theme following ALL instructions in this post https://www.drupal.org/node/2261457
______________________________________

I have already created a MAYO sub theme on another site and i have NO error.
If i put this old subtheme in a new install, the error appears !!!!!

______________________________________
I post here because i don't know if i have to create a new issue .

PS : try with MAYO 2.5 and i have same error with last dev version(2015-May-30)

Thanks

XTaz’s picture

Another test with the same MAYO subtheme, MAYO 2.5 and AcquiaDevDesktop:

It's OK if site running on PHP 5.3.29 and ERROR with php 5.4.39

mermentau’s picture

I don't think the PHP version is the problem. I'm running PHP 5.5.15 and 5.5.17. Did you try clearing cache and disable/re-enable MAYO and possibly disable/re-enable the sub-theme too?

XTaz’s picture

1- MAYO and subtheme disable
2- Clear all cache
3- re-enble MAYO and subtheme
4- Clear all cache again

I've got always same error

try the same with PHP 5.5.23 => same error

back to 5.3.29 without clearing cache => no error

mermentau’s picture

You are trying two versions of PHP, but are they not 2 entirely different installs of Drupal on two different servers?

I'll probably not be of much help unless you can guide me to seeing the issue on my side here.

XTaz’s picture

FileSize
100.89 KB

It's not 2 entirely different installs of Drupal on two different servers.
I test on localhost with Acquia Dev Desktop under Windows 7.

I try with a new D7 install true DevDesktop.
Install MAYO and my subtheme.
Under DevDesktop, i choose PHP 5.4.39.
Error message display on settings page of my subtheme. (admin/appearance/settings/mayo_sub).

Perhaps, i do something wrong but i don't see where.
I try to do same as https://www.drupal.org/node/2261457.

Sorry for my poor english

Join my sub theme files

mermentau’s picture

Saw the error using your sub-theme. Try editing sites/all/mayo/inc/plugins.inc line 34 to look like this:

array_unique($plugins_list, SORT_REGULAR);

XTaz’s picture

No more error after the change.
Very cool, thanks a lot.

mermentau’s picture

Category: Support request » Bug report
Status: Active » Fixed

Committed it to the dev version. Thanks XTaz for the report and sending the sub-theme for test.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.