Jump to content

Sort / Order By Issue


jonw118

Recommended Posts

I have program that pulls in a lot of different modules and centralizes them to one menu. One of the modules lists all the individual CMS pages. I need these pages to display by the "priority" column.

 

Unfortunately I've tried alot of different things to sort the CMS module pages by priority, but to no success. I hope I am providing all that is needed from the code here - and if anyone could lend any advise as to where I add the ORDER BY priority ASC I'd appreciate.

 

From the index page, here is the code that loads the modules... this is where I've been trying to dissect where modules join and how to create a sort order for bullet point CMS pages:

 

<?php
						foreach($sorted_modules as $module_name=>$seq)
						{
							if(count($menus[$module_name])==0 ) continue;?>
						<tr valign=top align=left>
							<td width=139 class="TextObject" style='padding-left:10px'>
								<?php if(strlen($menu_text[$module_name])>0)
								{?>
		<p><b><span	style="font-family: Arial, Helvetica, Geneva, Sans-serif; font-size: 11pt;">
		<?php echo ucwords($menu_text[$module_name]);?>-
		</span></b></p>
								<?php
								}
		foreach($menus[$module_name] as $name=>$action)
		echo "<li><span style='font-family: Arial,Helvetica,Geneva,Sans-serif; font-size: 10pt; color: rgb(39,90,121);'><a href='index.php?module=$module_name&action=$action'/>$name</a></span></li>";?>
							</td>
						</tr>
						<?php
						}?>

 

Thanks - hope this makes sense what I'm trying to do!

Link to comment
https://forums.phpfreaks.com/topic/192456-sort-order-by-issue/
Share on other sites

Hi

 

If the list of modules is coming from a database then sort them within the SQL (and at least post the SQL so we can see it).

 

If it is built up in another way then this is a PHP issue and you probably need to use one of the various php sort functions.

 

All the best

 

Keith

Link to comment
https://forums.phpfreaks.com/topic/192456-sort-order-by-issue/#findComment-1014230
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.