How do I distinguish menu items without children and display different content in panels or views?
This is an excellent example of a custom Ctools plugin. In this case, our plugin type is "Access". The below is copied from "term_has_parent", and adopted to search for the reverse. It could probably be improved with some more robust error checking.

In Panels, you will get a new "Selection Rule", so that you can distinguish between terms that have children, from those that don't.

&lt;?php
/**
 * Plugins are described by creating a $plugin array which will be used
 * by the system that includes this file.
 */
$plugin = array(
  'title' =&gt; t("Taxonomy: term has child(ren)"),
  'description' =&gt; t('Control access if a term has children.'),
  'callback' =&gt; 'term_has_child_ctools_access_check',
  'default' =&gt; array('negate' =&gt; 0),
  'summary' =&gt; 'term_has_child_ctools_access_summary',
  'required context' =&gt; new ctools_context_required(t('Term'), array('taxonomy_term', 'terms')),
);

/**
 * Check for access.
 */
function term_has_child_ctools_access_check($conf, $context) {
  $children = db_select('taxonomy_term_hierarchy', 't')
    -&gt;fields('t')
    -&gt;condition('parent', $context-&gt;data-&gt;tid)
    -&gt;range(0, 1)
    -&gt;execute()
    -&gt;fetchAssoc();

  return count($children) &gt; 1;
}

/**
 * Provide a summary description based upon the checked terms.
 */
function term_has_child_ctools_access_summary($conf, $context) {
  return 'Returns true if the current term has children';
}


If you don't know how to use a custom Ctools plugin, I suggest that is the topic of another question.