Menu icon Foundation
Foundation Magellan

Hello Friends!

So I currently have a project where I am using tabs, magellan, custom post types, and acf.

To give an idea of what I am working on:

Custom post type creates the content, acf fields within the post type with repeater fields, Tabs are of each post type, repeater fields are being used as magellan menu within each tab. 

The menu items within the tabs are dynamically created through php. There are conditional statements that check for specific urls and display different items for the requested pages. 

The issues that I'm seeing are: 

Magellan is working, but the active class is not being added to the target on the first tab. It is adding it when on the second tab, but to an incorrect target. 

Here is a segment of my code :

if( have_rows('content_category')) : $i = 0; // Third Tier Menu
              echo '<div class="dwld-menu" data-sticky-container><div class="sticky" data-sticky data-anchor="dwldContent"><div class="row"><ul class="menu column dwld-Mag" id="dwldMenu-'.get_the_ID().'" data-magellan data-options="barOffset:100;">';
                $tabCounter1 = 'A';
                $tabCounter1a = 1;
                $tabCounter1b = 'b';
                while( have_rows('content_category')) : the_row(); $i++;
                  $tabCounter1++;
                  $tabCounter1a++;
                  $tabCounter1b++;
                  $salesPortal = get_sub_field('sales_portal_only');
                  $catTtl = get_sub_field('content_title');
                  $catSubh = get_sub_field('content_sub_title');
                  $catContent = get_sub_field('collateral_content');
                  $assetContent = get_sub_field('collateral_main_content');
                  $assetLocation = get_sub_field('portal_location');
                  //if(!$salesPortal):
                  if(is_page('3711')) :
                    if ($assetLocation == 'general'):
                      echo '<li><a href="#dwld-'.get_the_ID().'-'.$tabCounter1.$i.$tabCounter1b.'"  class="">' .$catTtl.  '</a></li>';
                    endif;
                  elseif(is_page('4498')) :
                    if ($assetLocation == 'general' && $assetLocation !== 'microsoft'):
                      echo '<li><a href="#dwld-'.get_the_ID().'-'.$tabCounter1.$i.$tabCounter1b.'" class="">' .$catTtl.  '</a></li>';
                    endif;
                  elseif(is_page('2518')) :
                    if ($assetLocation == 'general' || $assetLocation == 'microsoft'):
                      echo '<li><a href="#dwld-'.get_the_ID().'-'.$tabCounter1.$i.$tabCounter1b.'" class="">' .$catTtl.  '</a></li>';
                    endif;
                  endif;

                endwhile;
              echo '</ul></div></div></div>';
            endif;

Magellantabsstickyhelp

Hello Friends!

So I currently have a project where I am using tabs, magellan, custom post types, and acf.

To give an idea of what I am working on:

Custom post type creates the content, acf fields within the post type with repeater fields, Tabs are of each post type, repeater fields are being used as magellan menu within each tab. 

The menu items within the tabs are dynamically created through php. There are conditional statements that check for specific urls and display different items for the requested pages. 

The issues that I'm seeing are: 

Magellan is working, but the active class is not being added to the target on the first tab. It is adding it when on the second tab, but to an incorrect target. 

Here is a segment of my code :

if( have_rows('content_category')) : $i = 0; // Third Tier Menu
              echo '<div class="dwld-menu" data-sticky-container><div class="sticky" data-sticky data-anchor="dwldContent"><div class="row"><ul class="menu column dwld-Mag" id="dwldMenu-'.get_the_ID().'" data-magellan data-options="barOffset:100;">';
                $tabCounter1 = 'A';
                $tabCounter1a = 1;
                $tabCounter1b = 'b';
                while( have_rows('content_category')) : the_row(); $i++;
                  $tabCounter1++;
                  $tabCounter1a++;
                  $tabCounter1b++;
                  $salesPortal = get_sub_field('sales_portal_only');
                  $catTtl = get_sub_field('content_title');
                  $catSubh = get_sub_field('content_sub_title');
                  $catContent = get_sub_field('collateral_content');
                  $assetContent = get_sub_field('collateral_main_content');
                  $assetLocation = get_sub_field('portal_location');
                  //if(!$salesPortal):
                  if(is_page('3711')) :
                    if ($assetLocation == 'general'):
                      echo '<li><a href="#dwld-'.get_the_ID().'-'.$tabCounter1.$i.$tabCounter1b.'"  class="">' .$catTtl.  '</a></li>';
                    endif;
                  elseif(is_page('4498')) :
                    if ($assetLocation == 'general' && $assetLocation !== 'microsoft'):
                      echo '<li><a href="#dwld-'.get_the_ID().'-'.$tabCounter1.$i.$tabCounter1b.'" class="">' .$catTtl.  '</a></li>';
                    endif;
                  elseif(is_page('2518')) :
                    if ($assetLocation == 'general' || $assetLocation == 'microsoft'):
                      echo '<li><a href="#dwld-'.get_the_ID().'-'.$tabCounter1.$i.$tabCounter1b.'" class="">' .$catTtl.  '</a></li>';
                    endif;
                  endif;

                endwhile;
              echo '</ul></div></div></div>';
            endif;