No announcement yet.

Disable Topic AJAX Pagination

First Prev Next Last
  • Filter
  • Time
  • Show
Clear All
new posts

    Official - Free Disable Topic AJAX Pagination

    vBulletin 5 uses AJAX pagination on topic pages. It has its advantages and disadvantages.

    1. It does not reload the page to fetch previous or next page of a topic. The post content is fetched using AJAX request to the server and dynamically rendered by the client-side using Javascript and jQuery. This means post content will generally load faster because it will not reload the page header and footer and other non-topic related content on the page.
    2. Less bandwidth used on the server because common images, CSS and Javascript and other resources will not be reloaded every time you navigate through the topic pages.
    3. Unposted reply you have typed in the editor will not be lost if you navigate to previous or next page or any page of the topic you're replying on.
    4. You can quote multiple posts located in different pages in a topic without losing existing quotes or content in the editor.
    1. If you have Javascript-based Ads (e.g. Adsense code) or custom HTML containing <script> tags inside a post, the Javascript will be stripped out by jQuery and will not be executed when user navigates to previous or next page of a topic. Less ad impressions means less earnings.
    2. If you have sidebar Ads, the ads will only render once on first load of a topic. Navigating to different pages in a topic will not re-render the ads. This means that the ads will be static and will have less impressions and less chance of clicks.
    3. Less page views recorded for a topic if you are using tracking page views using Google Analytics or similar. You wouldn't know which pages in a topic/thread has more page views.
    If the disadvantages outweigh the advantages for your needs especially disadvantage #1 and/or #2, you may want to disable the topic AJAX pagination. You can do it using a template hook. This works for both self-hosted vB5 and vBCloud.
    1. Log in to AdminCP.
    2. Create the product hook template.
      1. Go to Styles > Style Manager.
      2. Choose "Add New Template" from the dropdown of the target style.
      3. Enter "hook_disable_ajax_pagination" for the Title field.
      4. Paste the following code in the Template field.
        <script>(function(){window.addEventListener('load', function(){$('.pagenav-controls .arrow').off('click');$('.forum-conversation-content-widget').off('click', '.js-pagenav .js-pagenav-button');});})();</script>
      5. Click Save button.
      6. Repeat Steps 2.1 to 2.5 for each active style/theme your forum is using.
    3. Create the product hook.
      1. Go to Products & Hooks > Manage Template Hooks.
      2. Click [Add New Hook] link.
      3. Choose "conversation_below_entry" for the Hook Location dropdown.
      4. Enter "Disable AJAX Pagination by" for Title field.
      5. Enter "hook_disable_ajax_pagination" for Template Name. This is the template name you specified in Step 2.3.
      6. Click Save button.

    For self-hosted vB5, there's an easier way to do the above by simply downloading the attached zip file below, extracting it and then uploading the product XML file to Product & Hooks > Manage Products > [Add/Import Product].

    Attached Files
    Last edited by glennrocksvb; 04-17-2022, 09:34 PM.
    Helpful? Donate. Thanks!
    Buy me a coffeePayPal QR Code
    Fast VPS Host for vBulletin:
    A2 Hosting & IONOS

Latest Topics