Jump to content

Sorting the array by parent item


davo
 Share

Recommended Posts

I'm trying to sort my list out below, alphabetically by the title of the parent item, but my method is resulting in an error.

Could someone suggest what is wrong with the code below please.


function dmc_list(){
	$dmcs = wire('pages')->find("template=dmc");
        $dmcs->sort("$dmc->parent->title");
		echo"<div class='row'>";
                $dmc_total = count($dmcs);
                $column_total = $dmc_total / 3;
                $column_ceiling = ceil($column_total);
		$dmc_count = 0;	

		echo "<div class='container'>";	

				
				foreach($dmcs as $dmc){
					if((count($dmcs)>0) && ($dmc_count==0)) { echo "<div class='col-md-4'>";}
					
					$dmc_count ++;
					$region = $dmc->parent->title;
					if($region !== $new_region) { echo "<li  class='list-group-item list-group-item-info'><b>{$region}</b></li>";}
					$new_region = $dmc->parent->title;
					echo "<li> $dmc->title {$region}</li>";
						if($dmc_count == $column_ceiling){
								echo "</div>";
								$dmc_count = 0;	}
													
											
						if(count($dmcs) == 0) {
										echo "</div>";
												}
										}
                                                                      
							
echo "</div>";		
}

There's also a flaw in my logic here somewhere as the last column holds more items than the others...

Link to comment
Share on other sites

there is quite a bit wrong with this; where are your opening <ul> tags?

this looks like bootstrap 3 and you are trying to do a structure with a random # of columns (which you won't know ahead of time); looks like you want 3 items in each column, seems backwards...

also i don't see why you need the container.. this is the best i could do with limited info, and you never defined $new_region variable

<?php

function dmc_list(){
	
	$dmcs = wire('pages')->find("template=dmc");
    $dmcs->sort("parent.title");
	$dmc_total = $dmcs->count(); // if 100, then you have 34 columns, 3 rows?
	$column_total =  ceil($dmc_total / 3);
	$count = 0;	

echo"<div class='row'>";
	echo "<div class='col-md-4'>"; //start the first column
		echo '<ul>'; // start your first list
		foreach($dmcs as $dmc){
			
			$region = $dmc->parent->title;
			if($region !== $new_region) echo "<li class='list-group-item list-group-item-info'><b>{$region}</b></li>";
										echo "<li>{$dmc->title} {$region}</li>";
					
					if($count !== $column_total) {
					 	echo (++$count%3 ? "" : "</ul></div><div class='col-md-4'><ul>"); 
					 } elseif ($count === $column_total) {
					 	echo "</ul></div>";
					 }
																			
				} // end foreach                                                        						
echo "</div>"; // end row

this definitely won't work, because it won't be consistent with bootstrap framework (too many columns) and also the you will need 2 counts, one for columns and one for the UL... if you give me more info i will fix the code i postef

Link to comment
Share on other sites

Diogo:

Thanks, I'll give that a try this evening.

If that doesn't work, maybe I should go about this another way: loop through the regions and in every iteration of the loop, loop through child pages.

Macrura:

Good guess. Yes, it's bootstrap 3. Laziness stopped the opening ul tags. But, I should be able to insert them along with my opening closing div col tags yes?

I was trying to work it out with the following; list total pages, divide it by 3 for my 3 columns. Use ceil to round it up. When the counter reaches my column limit close the div and start again. If there are no more rows, close the div.

I thought I had new region sorted?

Link to comment
Share on other sites

there is quite a bit wrong with this; where are your opening <ul> tags?

this looks like bootstrap 3 and you are trying to do a structure with a random # of columns (which you won't know ahead of time); looks like you want 3 items in each column, seems backwards...

also i don't see why you need the container.. this is the best i could do with limited info, and you never defined $new_region variable

<?php

function dmc_list(){
	
	$dmcs = wire('pages')->find("template=dmc");
    $dmcs->sort("parent.title");
	$dmc_total = $dmcs->count(); // if 100, then you have 34 columns, 3 rows?
	$column_total =  ceil($dmc_total / 3);
	$count = 0;	

echo"<div class='row'>";
	echo "<div class='col-md-4'>"; //start the first column
		echo '<ul>'; // start your first list
		foreach($dmcs as $dmc){
			
			$region = $dmc->parent->title;
			if($region !== $new_region) echo "<li class='list-group-item list-group-item-info'><b>{$region}</b></li>";
										echo "<li>{$dmc->title} {$region}</li>";
					
					if($count !== $column_total) {
					 	echo (++$count%3 ? "" : "</ul></div><div class='col-md-4'><ul>"); 
					 } elseif ($count === $column_total) {
					 	echo "</ul></div>";
					 }
																			
				} // end foreach                                                        						
echo "</div>"; // end row

this definitely won't work, because it won't be consistent with bootstrap framework (too many columns) and also the you will need 2 counts, one for columns and one for the UL... if you give me more info i will fix the code i postef

Thanks Macrura

I didn't want that many columns.

I simply wanted three. I thought if I counted up the total number of rows in the array, that would be number of list items.

I then divided the list items by 3 and used the ceil function to up it the next round number.

then, add in the first bootstrap div column. spit the array into it with a counter.  when the counter reaches the frist limit point defined by the ceil variable it would test for this and add it the closing div for that column. It should then test to see if there are more items in the array. If there are add in another column div  and so on. Finally, if there are no more items in the array, add in the closing div.

does that explain what i'm trying to achieve? 1 list divided over 3 columns with approx 43 items in each column.

This is the result so far:

dmc.dudmc.com/about-du-and-dmcs/what-is-a-dmc-destination-management-company/

Using this template:

<?php 

/**
 * Page template
 *
 */

include("./dmcheader.inc"); 
include("./myfunctionlib.inc");

echo "              <div class='container'>
                        <div class='row'>
                           <div class='col-md-12'>";

				echo " {$page->body}

		           </div>
                        </div>";

dmc_list();


echo"               </div !-- end container -->";

include("./dmcfooter.inc"); 

 and this function:

function dmc_list(){
	$dmcs = wire('pages')->find("template=dmc");
	$dmcs->sort("parent.title");
        
		echo"<div class='row'>";
                $dmc_total = count($dmcs);
                $column_total = $dmc_total / 3;
                $column_ceiling = ceil($column_total);
		$dmc_count = 0;	

		echo "<div class='container'>";	

				
				foreach($dmcs as $dmc){
					if((count($dmcs)>0) && ($dmc_count==0)) { echo "<div class='col-md-4'>";}
					
					$dmc_count ++;
					$region = $dmc->parent->title;
					if($region !== $new_region) { echo "<li  class='list-group-item list-group-item-info'><b>{$region}</b></li>";}
					$new_region = $dmc->parent->title;
					echo "<li> $dmc->title {$region}</li>";
						if($dmc_count == $column_ceiling){
								echo "</div>";
								$dmc_count = 0;	}
													
											
						if(count($dmcs) == 0) {
										echo "</div>";
												}
										}
                                                                      
							
echo "</div>";		
}
Link to comment
Share on other sites

<?php

function dmc_list(){
    
    $dmcs = wire('pages')->find("template=dmc");
    $dmcs->sort("parent.title");
    $total = $dmcs->count();
    $items_per_column =  ceil($total / 3);
    $count = 0;    

echo"<div class='row'>";
    echo "<div class='col-md-4'>"; //start the first column
        echo '<ul>'; // start your first list
        foreach($dmcs as $dmc){
            $new_region = $dmc->parent->title; // why the same variable?
            $region = $dmc->parent->title;
            if($region !== $new_region) echo "<li class='list-group-item list-group-item-info'><b>{$region}</b></li>";
                                        echo "<li>{$dmc->title} {$region}</li>";
                        
                    if(++$count%$items_per_column) { // this will be false when we are on the last item in column
                        echo "";
                    } else { // this part will run when we are on the last item in the column
                        echo "</ul></div>";
                        if($count === $total) echo "<div class='col-md-4'><ul>"; // this will start a new column unless we're on the last item.
                    }
                                                        
                } // end foreach                                                                                
echo "</div>"; // end row

using the modulus :

$a % $b Modulus Remainder of $a divided by $b.

so if the items_per_column is say 40, then there will be no remainder when the count hits 40 (false condition) so then it uses the false clause and closes the tags, and start the new tags;

not perfect, but should give you some ideas about how to use some tricks to make it cleaner

  • Like 2
Link to comment
Share on other sites

Thank you Macrura

This almost worked, but it dropped the third column and produced the following result.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta name="verification" content="81dab63472f4ac83c90d62c4aaf071f8" />
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="../../docs-assets/ico/favicon.png">

    <title> What is a DMC (Destination Management Company) </title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

    <!-- Bootstrap core CSS -->
    <link href="/site/templates/dist/css/bootstrap.css" rel="stylesheet">

    <!-- Custom styles for this template -->

    <link href="/site/templates/customcss/custom.css" rel="stylesheet">

 






    <!-- Custom styles for the scroller template -->
    
<link href="/site/templates/assets/css/main.css" rel="stylesheet">
<link href="/site/templates/assets/css/prism.css" rel="stylesheet" />   
<link href="/site/templates/assets/css/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css" />







    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="../../docs-assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->

    <!-- Custom styles for this template -->
    <link href="/site/templates/customcss/navbar-fixed-top.css" rel="stylesheet"> 
    
    
    <script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?sensor=false'></script>




















  </head>

  <body>

    <!-- Static navbar -->
    <div class="navbar navbar-default navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand visible-lg visible-md" href="/"><img src="/site/templates/dulogotrans.png"></a>
          <a class="navbar-brand visible-xs visible-lg" href="/"><span style="color: #000066">destinations</span> UNLIMITED</a>
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
           <!-- <li class="active"><a href="/">Home</a></li> -->
        
            
	    <li class="dropdown" >
		<a href="#contact" class="dropdown-toggle" data-toggle="dropdown" ><span class="glyphicon glyphicon-info-sign"></span>
About Us<b class="caret"></b> </a>
		<ul class="dropdown-menu">
                <li><a href="/about-du-and-dmcs/about-du/">About destinations UNLIMITED</a></li>
		<li><a href="/about-du-and-dmcs/why-us/">Why Us</a></li>
		<li><a href="/about-du-and-dmcs/what-we-do/">DMC Criteria</a></li>

                <li><a href="/about-du-and-dmcs/what-is-a-dmc-destination-management-company/">What is a DMC</a></li>
                <li><a href="/about-du-and-dmcs/destinations-unlimited-csr-policy/">destinations UNLIMITED CSR Policy</a></li>
		<li><a href="/faqs/">FAQs</a></li>
		<li class=''><a href="/meet-the-team/">Meet The Team</a></li>
		<li class=''><a href="/about-du-and-dmcs/dmc-du-in-the-news/">dU In The News</a></li>
		<li class=''><a href="/events/calendar-of-events/">Calendar of Events</a></li>
                </ul>
            </li>

  

	    <li class="dropdown" >
		<a href="#contact" class="dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-search"></span>
DMCs Worldwide<b class="caret"></b> </a>
		<ul class="dropdown-menu">
                <li><a href="/region/">Represented DMCs</a></li>
                <li><a href="/dmc-non-represented/">Additional DMCs</a></li>
                <li><a href="/destination-updates/">Destination Updates</a></li>
		<li><a href="/destination-showcases/">Destination Showcases</a></li>
		<li><a href="/destination-deal-finder-results/">DMC Showcase Finder</a></li>
                </ul>
		
                </li>

	    <li class="dropdown" >
		<a href="#contact" class="dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-book"></span>
Resources<b class="caret"></b> </a>
		<ul class="dropdown-menu">
                <li><a href="http://www.dudmc.com/brochure/du2013july/du2013july.html">dU Brochure</a></li>
                <li><a href="/destination-videos">DMC Destination Videos</a></li>
                <li class="divider"></li>
                <li><a href="/links/conference-and-incentive-useful-links">Conference and Incentive Links</a></li>
                <li><a href="/events/annual-event-and-congress/">Annual Events and Congress</a></li>
                <li class=''><a href="/gallery/">Image Gallery</a></li>
		<li class=''><a href="/dmc-special-offers/">DMC Special Offers</a></li>
		<li class=''><a href="/dmc-news/">DMC News</a></li>
		<li class='disabled'><a href="">CSR Ideas</a></li>
                </ul>
		
                </li>

	    <li class="dropdown" >
		<a href="#contact" class="dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-thumbs-up"></span>
Testimonials<b class="caret"></b> </a>
		<ul class="dropdown-menu">
		<li><a href="/testimonial-types/testimonials-from-event-companies/">Testimonials From Event Companies</a></li>
                <li><a href="/testimonial-types/dmc-client-testimonials/ ">DMC client Testimonials</a></li>
                <li><a href="/testimonial-types/partner-dmcs/ ">Partner DMCs</a></li>  
		<li class="divider"></li>    
		<li><a href="/forms/review/ ">Leave a review</a></li>
                </ul>
		
                </li>


  <li class="dropdown" >
		<a href="#contact" class="dropdown-toggle" data-toggle="dropdown"  ><span class="glyphicon glyphicon-envelope"></span>
Contact<b class="caret"></b> </a>
		<ul class="dropdown-menu">
                <li class='' ><a href="/forms/request-for-proposal/">Request For Proposal</a></li>
                <li class='' ><a href="/forms/mailing-list/">Join Our Mailing List</a></li>
                <li class='' ><a href="/forms/get-in-touch/">Get In Touch</a></li>
   
</ul>
		
                </li>
 



          </ul>
          

		<ul class="nav navbar-nav navbar-right visible-lg">
			<li><a href="http://uk.linkedin.com/company/destinations-unlimited---dmc-representation?trk=ppro_cprof" target='_blank'><img src="/site/templates/assets/img/social/linked-in.gif"></a></li>
            
			<li><a href="https://www.facebook.com/dUDMCs" target='_blank'><img src="/site/templates/assets/img/social/facebook.gif"></a></li>
            
			<li><a href="https://twitter.com/dU_DMCs" target='_blank'><img src="/site/templates/assets/img/social/twitter.gif"></a></li>
            
			<li><a href="https://www.youtube.com/channel/UCY4C2Xfg-GZzhakz7_EtCZA" target='_blank'><img src="/site/templates/assets/img/social/youtube.gif"></a></li>
   
                        <li><a href="https://plus.google.com/+Dudmc/posts" target='_blank'><img src="/site/templates/assets/img/social/googler.gif"></a></li>  
			<li><a href="http://www.pintrest6.com/dudmc/" target='_blank'><img src="/site/templates/assets/img/social/pintrest6.gif"></a></li>     
</ul>





        </div><!--/.nav-collapse -->

      </div>
    </div>



     

    
              <div class='container'>
                        <div class='row'>
                           <div class='col-md-12'> <h2 class="art-postheader">What is a DMC (Destination Management Company) ?</h2><p>A DMC provides local destination knowledge and they act as a extension of your company</p><p>A DMC (Destination Management Company) offer the following logistic services in their destination; Meet and Greet, Transfers / Transportation, Hotel Accommodation, Restaurants, Activities, Excursions, Conference Venues, Themed Events, Gala Dinners and Logistics. Naturally, DMCs assist with overcoming any language barriers.</p><p>A DMC must be someone that you can relate to and trust, whilst they assist you on both a creative and professional level. They are often able to provide preferential rates based on the buying power that they have with their preferred suppliers.</p><p>The above is only a basic overview of the services that a DMC can provide.</p>

		           </div>
                        </div><div class='row'><div class='col-md-4'><ul><li>Egypt Incentives and Events African</li><li>Destination Kenya African</li><li>Unitours Maroc African</li><li>Green Route African</li><li>Expresso Veiga African</li><li>Mauritours African</li><li>Select-Seychelles African</li><li>Tour East Asia</li><li>Cox & Kings Ltd Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Cox & Kings Ltd Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Toptour (Europe) Limited Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Cox & Kings Ltd Asia</li><li>Tour East Asia</li><li>Cox & Kings Ltd Asia</li><li>Arinex Australasian</li><li>Arinex Australasian</li><li>Arinex Australasian</li><li>Tahiti Nui Travel Australasian</li><li>Connect Travel Services Carribean</li><li>Barefoot Holidays Carribean</li><li>Carib World Travel Carribean</li><li>Sunlinc Barbados Carribean</li><li>Business Serenity Carribean</li><li>Sunlinc Grenada Carribean</li><li>Travel Services Inc Carribean</li><li>Sunlinc St. Kitts Carribean</li><li>Premier Destination Services Carribean</li><li>Elcotour Central and South American</li><li>SAT Mexico Central and South American</li><li>Top Dest Central and South American</li></ul></div><li>S & L Travel Services and Tours Central and South American</li><li>Turismo Balsa Central and South American</li><li>Destination Management Chile Central and South American</li><li>Vitramar Central and South American</li><li>Via-Tur Central and South American</li><li>Ecuadorian Tours Central and South American</li><li>Servicios Turisticos del Peten (STP) Central and South American</li><li>Eventos Kreativos Internacional Central and South American</li><li>Intertours Central and South American</li><li>Coltur Peru Central and South American</li><li>Turisport Ltd Central and South American</li><li>Condor Verde Central and South American</li><li>AIM Group International European</li><li>Borealis European</li><li>AIM Group International European</li><li>First United European</li><li>Metropolis European</li><li>CPO Hanser European</li><li>Weichlein European</li><li>Conceptours European</li><li>ITB Holland European</li><li>AIM Group International European</li><li>Atlantik European</li><li>Wallace Travel European</li><li>Intercontinental Travel Company European</li><li>EC Meetings European</li><li>Travel Planners of Scandinavia European</li><li>Mazurkas Travel European</li><li>XPTO Marketing European</li><li>Accent Travel European</li><li>ITB DMC European</li><li>ITB DMC European</li><li>ITB DMC European</li><li>Risbecker European</li><li>Ovation European</li><li>Gemini European</li><li>Rusmice European</li><li>AIM Group International European</li><li>Dubrovnik Travel European</li><li>CPO Hanser European</li><li>Con-ex European</li></ul></div><li>Travellers Choice European</li><li>Spectra European</li><li>Con-ex European</li><li>Con-ex European</li><li>AIM Group International European</li><li>ITB DMC European</li><li>Albatros Travel DMC European</li><li>1001 Events Middle Eastern</li><li>1001 Events Middle Eastern</li><li>Egypt Incentives & Events Middle Eastern</li><li>Eshet Incentives & Conferences Middle Eastern</li><li>Karma House Middle Eastern</li><li>1001 Events Middle Eastern</li><li>Tamna Events Middle Eastern</li><li>Canadian Tours International CTI North America and Canadian</li><li>Incentive Travel & Meetings Atlanta North America and Canadian</li><li>NxtEvent North America and Canadian</li><li>AgenTours North America and Canadian</li><li>Manhattan Passport North America and Canadian</li><li>Capitol Services Inc North America and Canadian</li><li>Select Sites Group North America and Canadian</li><li>Agentours North America and Canadian</li><li>Charlotte Arrangement North America and Canadian</li><li>Incentive Travel & Meetings North America and Canadian</li><li>GET Destinations North America and Canadian</li><li>Convention Designs North America and Canadian</li><li>Capitol Services Inc North America and Canadian</li><li>Agentours North America and Canadian</li><li>Passport New Mexico North America and Canadian</li><li>Albrecht Events North America and Canadian</li><li>Destination St. Louis North America and Canadian</li><li>MAC Meetings North America and Canadian</li><li>Destination San Antonio North America and Canadian</li><li>NxtEvent North America and Canadian</li><li>Destination Nashville North America and Canadian</li><li>Incentive Travel & Meetings North America and Canadian</li><li>Key Events & Helen Moscovitz Group North America and Canadian</li><li>Ultimate Ventures North America and Canadian</li><li>Accent on Arrangements North America and Canadian</li></div>               </div !-- end container -->


<!-- FOOTER -->
<div id="footer"> 

 <div class="container">
    
        <p class="pull-right"><a href="#">Back to top</a></p>
        <p>© 2014 dU, Inc. · <a href="#">Privacy</a> · <a href="#">Terms</a></p>
        <p class="text-muted">destinations UNLIMITED Tel: + 44 (0) 1425 461311 - Email: info@dudmc.com - Skype Address: duoffice Address: 7 High Street, Ringwood, Hampshire, BH24 1AB, United Kingdom - <a href='/portal/login'>DMC Login</a> </p>
      
</div>     

<!--  
<img class='img img-responsive' src='/site/templates/assets/img/dmc_bottom_banner.jpg'>	  
-->
</div>      

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->

    <script src="/site/templates/dist/js/bootstrap.min.js"></script>

 
<script src="/site/templates/assets/js/jquery.mCustomScrollbar.min.js"></script>
<script src="/site/templates/jquery.newsTicker.js"></script>
    
<script>
    		$('a[href*=#]').click(function(e) {
			    var href = $.attr(this, 'href');
			    if (href != "#") {
				    $('html, body').animate({
				        scrollTop: $(href).offset().top - 81
				    }, 500);
				}
				else {
					$('html, body').animate({
				        scrollTop: 0
				    }, 500);
				}
			    return false;
			});

    		$(window).load(function(){
	            $('code.language-javascript').mCustomScrollbar();
	        });
            var nt_title = $('#nt-title').newsTicker({
                row_height: 40,
                max_rows: 1,
                duration: 3000,
                pauseOnHover: 0
            });
            var nt_example1 = $('#nt-example2').newsTicker({
                row_height: 50,
                max_rows: 1,
                duration: 4000,
                prevButton: $('#nt-example2-prev'),
                nextButton: $('#nt-example2-next')
            });
</script>
  
<script>var as_config = {"as_minLength":2,"as_close_text":"close","as_search_form":"#my_search_form","as_search_input":"#my_search_query","as_query_name":"q","as_query_url":""};</script>
<script src='/site/modules/AjaxSearch/AjaxSearch.js'></script></body>
</html>

The reason I had this part in:

            $new_region = $dmc->parent->title; // why the same variable?
            $region = $dmc->parent->title;

is because each of the dmcs in the list come under a different parent. I'd ordered the array by the parent. When I put those to variables in that look the same, I put one at the start of the loop and one at the end and the test in the middle. That way when it ran through the loop, if the region was different to the one triggered by the previous loop item then it would print the new region in a fancy new label.

Link to comment
Share on other sites

yeah - sorry there was an error:

if($count !== $total) echo "<div class='col-md-4'><ul>";

that should fix it and make it start the new column;

you should be able to put back your variable logic how you want, to get the new region label;

i think it's really important to comment your code, so that anyone looking at it can understand it, especially if you are posting to a forum; so commenting the logic all the way through would make it easier for us to follow what you're trying to do.. also can't guarantee this will work without being able to test it... 

  • Like 1
Link to comment
Share on other sites

Thank you. I'll try this out tonight. Totally agree about the comments. I started  doing this as of last night when I started to get lost in my own code mess! Cheers

Link to comment
Share on other sites

yeah - sorry there was an error:

if($count !== $total) echo "<div class='col-md-4'><ul>";

that should fix it and make it start the new column;

you should be able to put back your variable logic how you want, to get the new region label;

i think it's really important to comment your code, so that anyone looking at it can understand it, especially if you are posting to a forum; so commenting the logic all the way through would make it easier for us to follow what you're trying to do.. also can't guarantee this will work without being able to test it... 

Thank you. Looks great.

http://dmc.dudmc.com/about-du-and-dmcs/what-is-a-dmc-destination-management-company/

I'm learning bootstrap at about the same rate as pw, so all help gratefully received.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...