Menu Listing

8 posts by 2 authors in: Forums > CMS Builder
Last Post: June 24, 2008   (RSS)

Re: [merid] Menu Listing

By Dave - June 23, 2008

Hi Rolly,

We just need to find something unique about that situation that can test for. It looks like all the sub menu options have a number on the end of the url (that's what we use to lookup the record).

What if we wrap the sub menu options in this so they only display when there is a number on the end of the url?

<?php if (getNumberFromEndOfUrl()): ?>
... sub menu options ...
<?php endif ?>

Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Menu Listing

By merid - June 23, 2008

Thanks Dave.

I tried putting the if statement in 2 places. Here is the last I got:

<?php foreach ($contact_usRecords as $record): ? >
<tr>
<td width="11%"><img src="images/clear.gif" / height="2" width="22"></td>
<td width="89%" align="left"><img src="images/clear.gif" / height="4"><br />
<?php if (getNumberFromEndOfUrl()): ?><a href="<?php echo $record['_link'] ?>"><font color="#FFFFFF"><?php echo $record['title'] ?></font></a><?php endif ?><br/>
</td>
</tr>

<?php endforeach; ?>

<?php if (!$contact_usRecords): ?>
No records were found!<br/><br/>
<?php endif ?>

Result: The other submenu did not appear too. http://www.05.meridianwebdesign.com/contact-us.php .

I tried putting it after the foreach. The same result.

Re: [merid] Menu Listing

By Dave - June 23, 2008

Hi Rolly,

I just had a look at the link you sent. Is it working the way you want it to now? Looks like you beat me to it! Let me know if you need any more help with that.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Menu Listing

By merid - June 23, 2008

No Dave. It is not working yet. There is supposed to be a submenu entitled "Directions & Map" but it is not showing. Apparently, the if statement did not work. "Direction & Map" has a number at the end of the url yet it did not show. It is supposed to be the second submenu. My problem I think is the pinpointing where to add the If statement.

Rolly

Re: [merid] Menu Listing

By Dave - June 24, 2008

Is that under Contact Us? Is that the last one that isn't working? It looks like it's backwards. All the other menus are closed until you click on them and then they pop open. But Contact Us isn't, but if you link with a number it opens up:

http://www.05.meridianwebdesign.com/contact-us.php?Directions-Map-2

Can you use the same code as worked for the other main menu options?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Menu Listing

By merid - June 24, 2008

Yes, I am talking about "Contact Us" Dave. I inserted the code and I got this

http://www.05.meridianwebdesign.com/contact-us.php

where all the submenus are gone.

What I wanted is the following but without the "contact us" submenu appearing to avoid repeating it:

http://www.05.meridianwebdesign.com/contact-ustest.php

Thanks.

Rolly

Re: [merid] Menu Listing

By Dave - June 24, 2008

Is the code for the menu duplicated on each of those pages or from a common include file.

What if we tested for if the url contained "contact-us" and showed it open with sublinks in that case? Would that work?

This code will test for that:
<?php if (strpos($_SERVER['SCRIPT_NAME'], "contact-us")): ?>

...

<?php endif; ?>


Hope that helps.
Dave Edis - Senior Developer
interactivetools.com