ASU Web Community

Drupal Template --> Secondary Links

Thursday, January 10th, 2008 - 1:33 pm
  • dhleach
  • dhleach's picture

I have just started converting the HTML website we made to Drupal - in the past I enabled the hidden secondary bar (see iullistration) underneath the primary links in the header. In this I was able to insert custom links.

Looking at style.css I can see that it still exists, just not where to enable it and add the links. It was suggested that creating secondary links in drupal "menus" would do it, but no luck. Any ideas?

Thursday, January 10th, 2008 - 2:04 pm
  • bbailey1
  • bbailey1's picture

Without actually taking a look, I would suggest making sure that your secondary links block is pointing to the right spot.

To check, go to Administer > Site Building > Blocks

You should see a dropdown next to the secondary links menu you created. Change that to the secondary block (or whatever it may be called) and it should show up.

Hope that helps!

Friday, January 11th, 2008 - 6:36 pm
  • dhleach
  • dhleach's picture

Thanks - my deal is that I expect there to be a kind of WYSIWYG way of enabling everything... which in this case there isn't. I created a block, called it "secondary," clicked on configure, and pasted links inside of a div tag labled "secondary," which picked up the styling I mentioned earlier in my previous post. I was hoping there would be a better way of getting it to work...

Monday, January 14th, 2008 - 8:39 am
  • bbailey1
  • bbailey1's picture

I'm glad that you were able to get that to work, but I don't think that I explained it fully. You don't need to copy links inside of your block. When you create a menu, Drupal automatically creates the block, but disables it by default. Simply go into the Blocks admin page under "Disabled" and set it to the region you want it to show up in. Again, I don't know how you have your regions set up, but switch your menu block with the one you created manually and everything should work.

Monday, January 14th, 2008 - 10:32 am
  • dhleach
  • dhleach's picture

That was how I was expecting it to work... it just doesn't work right. See below:

 

 

As you can see, it doesn't yield the desired result. I am thinking that I just didn't name my menu correctly... but I am not well versed enough in PHP to find out where the ASU template would call the menu and apply the appropriate CSS (and thusly find out what the name should be). I couldn't imagine that the secondary bar as shown in the first post would be built into the ASU template w/o it being able to be installed as you had described.

Monday, January 14th, 2008 - 12:05 pm
  • ngudmuns
  • ngudmuns's picture

Hey Daniel, those are good points. The ASU Drupal theme was designed to be a quick & dirty method to get an ASU-ish site on the web.  We had originally played around with making the maroon bar links (ASU Home, ASU A-Z Index, etc) the primary links, but instead switched it up, as those should not be edited by users. This was to help enforce the "ASU brand," so that all sites looked alike.

Now, if you'd like to manage the secondary links, you'll have to do some hacking.  In page.tpl.php inside the asuzen themes folder, You can create a new div above this one:

<div id="container" class="clear-block">

You'll have to call the code to invoke the secondary menu. The theme has actually styled it already, so all you have to do is insert into the page template (/sites/all/themes/asuzen/page.tpl.php) the following bolded code:

    <?php if ($header): ?>
    <div id="header-region">
    <?php print $header; ?>
    </div>
    <?php endif; ?>

    <?php if($secondary): ?>
          <div id="secondary" class="secondary">
          <?php echo $secondary; ?>
          </div>
      <?php endif; ?>

    <div id="container" class="clear-block">

Once you do that, your theme should display the secondary links. If, for some reason it doesn't, you'll have to check your menu settings. Make sure under the menu admin section there is a menu called "Secondary Links" with at least one menu item. I chose to create one called "Test Menu Item."  Then, click menu settings and make sure you've assigned the "Menu containing secondary links:" to the "Secondary Links" option in the dropdown. Once you've done that, you should see the following show up:

 

Hope this helps!

Monday, January 14th, 2008 - 1:53 pm
  • dhleach
  • dhleach's picture

This is EXACTLY what I was looking for. It worked great in both IE and FF.

 

 

Beats having the use THIS as a custom block in the header section.