2

I have a Drop down mega menu using a CSS file and a HTML file. I want to use this instead of the Drupal primary menu. I have been advised to change the HTML in the page-header.inc file but I don't know how to do this?

On looking at the page-header.inc file, do I place the code under the file or in the header? I have no idea! Do I have to change this section?

<?php if (isset($primary_links)) : ?>
    <?php print theme('links', $primary_links, array('class' => 'links primary-links')) ?>
<?php endif; ?>

Any advice would be great, I'm new at this.

2
  • I do not know of page-header.inc. That is not a standard Drupal file. Can you tell us what theme you are using and what version of Drupal it is for?
    – berkes
    Commented Sep 9, 2011 at 11:51
  • i'm using openpublic_eu theme and drupal 7 ...i now have superfish menu displaying for me, i have modified the css files to change the colour but changes aren't taking effect. on the superfish set up page it asks for html wrappers, there is no way to add my custom html code for the content of superfish mega menu? Commented Sep 9, 2011 at 13:23

4 Answers 4

1

You could alter the menu attributes using template.php file and its functions exclusively for menu.

0

Since menu provides hooks, I think it's better to create a custom module a use hook_menu to customize your menu rather than editing directly your template file. This may also help you. You can also use Menu CSS Name for that.

0

If I understand well your question, I think that an alternative could be add the html of your menu to a block (using a block you can handle where and who can see your menu):

enter image description here enter image description here

(full html is a feature less strict to use html tags)

the CSS rules can be handled from a CSS file using the html.php.tpl in modules > system file. copy/paste html.php.tpl file inside your template directory and edit it to add your tag to call CSS. Also is possible for your test, add your CSS with your html menu:

<style type="text/css">
....
</style>
<!-- now your html menu -->
<div>
....
</div>

I hope information be useful.

0

There are quite a few options, such as the valid suggestions above.

As you already have the HTML and CSS, the easiest way is to insert it into a page template, such as page-front.tpl.php for the Front page only or page.tpl.php (you'll find this in your theme folder).

You should place your html in within the <body> tag, preferably within the <div id="main-menu" class="navigation"> element should you want it there, and amend your theme.info to include a new stylesheet or else insert the css into sytle.css (again found in your theme folder).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.