Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By .carey on
I'm using the Interlaced theme, and I want put a search at the top in the "primary links" section. But the theme isn't setup like others. It doesn't have page.tpl.php etc. It has "interlaced.theme". And the php code is different. This is confusing for a noob like me.
Can someone please tell me what I need to change - and to what?
$output .= '<table style="width: 100%; vertical-align: top;" cellspacing="0" cellpadding="0">
<tr>
<td style="vertical-align: top;" class="headersitename">
';
$output .= theme_get_setting('toggle_name') ? variable_get("site_name", "drupal") : '';
$output .= '
</td>
</tr>
';
$primary_links = theme('links', menu_primary_links());
if ($primary_links) {
$output .= '<tr>
<td class="headerlinks">
'. $primary_links .'
</td>
</tr>
';
}
Comments
An awesome PHP geek here?
So there is an awesome PHP geek here that can help me put search in the top menu of this theme?
It's not too hard
I've customized interlaced.theme beyond recognition--it's pretty easy. Don't be afraid.
$output .= 'xx' means "APPEND 'xx' onto the end of the variable '$output'. Just about all of the statements in a .theme are like this.
So all you have to do is make your own. I've edited the code you posted with an example:
I appreciate your hard work, dgp.
Interesting! I had tried this:
You know, I figured from this:
<?php print $search_box ?>
But I didn't define it ($searchform = '<form action="????">
...). And, of course, it didn't work.So, when I didn't get a response to my post I converted interlaced.theme over to use page.tpl.php etc. using Bluemarine as a guide. And then inserted $search_box. Viola!
In the long run, with all the customizing I am doing, and with more than one site, the conversion has benefited greatly. But I sure do wish I knew PHP. Just haven't been able to wrap my head around it yet.
Many thanks for teaching me something. ;)