Jump to content

Testing the array for field content


davo
 Share

Recommended Posts

I have a number of pages brought back in the array and I want to test to see if each any one of the pages in the array has a certain field with content. I could probably loop through the array but seem to remember if there was a simpler method. I've tried the below which doesn't work:

$showcases = $pages->find("template=dmc_update_link, DMC_select=$pageid, parent=1209");

$countshowcases = count($showcases);
if (($countshowcases > 0) && ($showcases->DMC_update_doc !=="")) {
echo "					
					<a data-toggle='collapse' data-parent='#accordion' href='#collapsefour'  class='list-group-item active'><span class='glyphicon glyphicon-collapse-down'></span> Destination Showcases <span class='badge'>{$countshowcases}</span></a>
					<div id='collapsefour' class='panel-collapse collapse'>
					<div class='panel-body'>";
foreach ($showcases as $showcase)	{
					echo "<li class='list-group-item'><a href='{$showcase->DMC_update_doc->url}' target='_blank'>Showcase {$showcase->title}</a> </li>";
					}
					echo "</div></div>";
			}
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...