XF 1.5 AJAX works but isn't putting out header or breadcrumbs

SkyeLogic

Member
I am using AJAX on my site and it's working. Whenever you click a link, the site loads with the new content. The new content, however, isn't the full content and only partial. The new content doesn't include the header or breadcrumbs. Here is my code:
Code:
//* @param {jQuery} $ jQuery Object */
!function($, window, document, _undefined)
{
    XenForo.ContentLoader = function($link)
    {
        $link.click(function(e)
        {
            e.preventDefault();
        
            XenForo.ajax(
                $link.attr('href'),
                {},
                function(ajaxData, textStatus)
                {
                    if (ajaxData.templateHtml)
                    {
                        new XenForo.ExtLoader(ajaxData, function()
                        {
                        $(ajaxData.templateHtml).xfInsert('replaceAll', $link.data('target'));
                        });
                    }
                }
            );
        });
    }

        // *****************************************************************
        
        XenForo.register('a.ContentLoader', 'XenForo.ContentLoader');
}
(jQuery, this, document);

Whenever you click a link with class="ContentLoader" data-target="#whatever", the new content loads wherever specified with id="whatever"

I would like the code to be loaded like this:
http://ourworldfm.com/v2/pages/about/

Now click about us at the bottom of the page. You will see the template is being stripped of breadcrumbs and header. WHY?! Anyone please help.
 
You'll need to consider taking a different approach. We never return any of the "container" data with Ajax/JSON requests.
 
Back
Top Bottom