Announcement

Collapse
No announcement yet.

Disable Topic AJAX Pagination

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

    Free Mod Disable Topic AJAX Pagination

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

    Advantages:
    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.
    Disadvantages:
    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.
        Code:
        <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 vBMods.rocks" 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].

    Enjoy!
    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

Users Viewing This Page

Collapse

There is 1 user viewing this forum topic.

  • Guest Guest

Latest Posts

Collapse

Working...
X
Searching...Please wait.
An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

Please push the back button and reload the previous window.'
An unexpected error was returned: 'Your submission could not be processed because the token has expired.

Please push the back button and reload the previous window.'
An internal error has occurred and the module cannot be displayed.
There are no results that meet this criteria.
Search Result for "|||"