Sorting List By Country
8 posts by 3 authors in: Forums > CMS Builder
Last Post: January 19, 2011 (RSS)
By Joseph - January 10, 2011
Sorting Mas Band list by country
on the left hand side of the page it currently shows a list of all mas bands but i would only like to show the countries of the mas band so that when clicked the country opens up a new page with mas bands relevant to the country.
http://www.socanews.com/masbands/indexMas2.php
Thanks
Joseph
Re: [socanews] Sorting List By Country
By Jason - January 10, 2011
How are you storing country in the masband? Is it just text, or is it in a list field?
Also, do you have a page that will display all the bands of a single country? If so, could you attach that page?
Let me know and I can give you some examples.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Sorting List By Country
By Joseph - January 11, 2011
The country are taken from a list field.
I dont have a physical page that list the bands by country i normally use this serch
http://www.socanews.com/masbands/index.php?country_keyword=trinidad
so for example the link above will shows bands from a particlar country Trinidad.
Joseph
Re: [socanews] Sorting List By Country
By Chris - January 17, 2011
Can you please post the full PHP source code of both of the pages you linked? Actually, all I'd need to see is the getRecords code, but if you want to simply post the entire pages, that's fine too.
Chris
Re: [chris] Sorting List By Country
By Joseph - January 17, 2011
page has been attached.
Joseph
Re: [socanews] Sorting List By Country
By Chris - January 18, 2011
I think you want to output a list of links for your country field's list options. Is that right? If so, this code will do that for you:
<?php foreach (getListOptions('masbands', 'country') as $value => $label): ?>
<a href="/masbands/index.php?country_keyword=<?php echo htmlspecialchars($value) ?>">
<?php echo htmlspecialchars($label) ?>
</a>
<br/>
<?php endforeach ?>
Does that help? Please let me know if you have any questions.
Chris
Re: [chris] Sorting List By Country
By Joseph - January 18, 2011
not sure exactly where that code should go on the page.
Joseph
Re: [socanews] Sorting List By Country
By Chris - January 19, 2011
I'm guessing that you'd want to replace everything from <?php foreach ($masbandsRecords as $masbands): ?> to its corresponding <?php endforeach ?>.
Chris