Hello, I’m more of an HTML/Graphics guy, but have used PHP off-on for a number of years. I have a client with a CMS-based website that has an inventory page in which there is a list of car makes displayed (i.e. Chevy, Dodge, Ford, etc.) on the page’s nav bar…
The list is displayed alphabetically, but the client wishes to have one of the makes appear at the top of the list on the nav bar, but keep the remainder of the list alphabetized on the page…
So for example what is now:
- Austin-Healy
- Cadillac
- Chevy
- Dodge
etc…
would be:
- Chevy
- Austin-Healy
- Cadillac
- Dodge
etc…
Here’s the existing code:
VIEW BY MAKE
- <?php echo anchor('inventory','All Makes','') ?> <?php foreach ($makes as $m) : ?> <?php $class = ($m->make == urldecode($this->uri->segment(3))) ? 'class="make-selected"' : ""; ?>
- <?php echo anchor('inventory/make/' . $m->make, $m->make, "$class"); ?> <?php endforeach; ?>
Thanks for any help with this!