• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
      • Try XenForo Demo
      • New Posts
      • FAQ
      • Calendar
      • Community
        • Groups
        • Albums
        • Member List
      • Forum Actions
        • Mark Forums Read
      • Quick Links
        • Today's Posts
        • Who's Online
      • Sponsor
        • Sponsor a Feature
        • List of Donors
    • Wiki
    • Support
    • What's New?
    • Buy Now
    • Manual
    • 
    • Forum
    • VaultWiki How-Tos
    • VaultWiki Questions
    • XF1.5, AMP pages broken since VaultWiki installed

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Results 1 to 7 of 7

    Thread: XF1.5, AMP pages broken since VaultWiki installed

    • Thread Tools
      • Show Printable Version
    1. August 5, 2019 #1
      mazzly
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      mazzly is offline
      Junior Member
      Join Date
      July 26, 2019
      Posts
      8
      Rep Power
      0

      Exclamation XF1.5, AMP pages broken since VaultWiki installed

      We have AMP versions of our threads with the following plugin https://xenforo.com/community/resour...-xenforo.5696/

      Since the installation of VaultWiki a day ago, google search console now started complaining about broken AMP pages..

      Looking at the amp variants now and running validation check, there are a bunch of custom VW_* <script> that try to load at the bottom of the page, which is not allowed with AMP pages. It has also broken some other small things with AMP content.

      Example link: https://www.thetolkienforum.com/thre...r.19028/?amp=1

      Problem is that I can't find where these scripts/tags are inserted/modified.

      How/where can I modify so that those scripts/modifications are not done with ?amp=1 exists in the URL?

      Would be nice if someone could provide help with which template I need to modify to prevent VW from inserting those tags..
      Reply With Quote Reply With Quote

    2. August 7, 2019 #2
      pegasus
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      pegasus is offline
      VaultWiki Team
      Join Date
      March 28, 2004
      Location
      New York, NY
      Posts
      2,959
      Blog Entries
      18
      Rep Power
      688
      Do you know what the appropriate test is to check whether AMP-mode is active?

      The script tags are not adding via a template. They are appended in PHP. We would have to add a PHP test to see if the add-on has activated AMP-mode for a request.

      Checking for ?amp=1 alone is not sufficient. For example, I can just add it to the URL of this page, and nothing will happen because I don't have the AMP-addon installed. Or even if I do, maybe I have the add-on disabled or the add-on's settings disabled. But if I add the test for ?amp=1 to VaultWiki, then VaultWiki will incorrectly perform AMP-mode even though there is not AMP-mode right now.
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    3. August 7, 2019 #3
      mazzly
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      mazzly is offline
      Junior Member
      Join Date
      July 26, 2019
      Posts
      8
      Rep Power
      0
      Sorry I do not know what the appropriate test to check if AMP-mode is activated..

      I don't necessarily agree that ?amp=1 is not a sufficient test? could it maybe be a specifiable param to disable insertion of extra script tags?

      Also: Why are there a bunch of script tags inserted to normal thread_view? shouldn't those be added only for wiki-related pages?

      Could you tell me which .php file to modify if I want to add the ?amp=1 test myself?
      Reply With Quote Reply With Quote

    4. August 7, 2019 #4
      pegasus
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      pegasus is offline
      VaultWiki Team
      Join Date
      March 28, 2004
      Location
      New York, NY
      Posts
      2,959
      Blog Entries
      18
      Rep Power
      688
      They are added to thread_view because a regular post can use wiki-related BB-Codes even though it is not a wiki-related page. Because post content is cached, the script tags cannot be queued directly when the BB-Code tags are parsed. Instead we have to assume that any BB-Code might be parsed, and pre-load a library. The library will load other scripts after the page loads, if it decides the extra scripts are needed.

      You can write a listener to override vw_Global_View_XF2 ([vault/core, library/vw/_core, src/addons/vw/vw/_core]/view/global/xf2.php) using the event vw_load_view in vw_Hard_Core::resolve_class_name (vault/core/model/vw.php, vault/_hard/core.php, library/vw/_hard/core.php, src/addons/vw/vw/_hard/core.php).

      You may want to affect one or more of the following methods:
      - add_script
      - get
      - render_script_tag
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    5. August 7, 2019 #5
      pegasus
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      pegasus is offline
      VaultWiki Team
      Join Date
      March 28, 2004
      Location
      New York, NY
      Posts
      2,959
      Blog Entries
      18
      Rep Power
      688
      The appropriate test is to ensure all of the following:
      - Check that the URL has ?amp=1
      - Check that the add-on NixFifty_AMP is active.
      - Check that the controllerResponse has: containerParams['AMP']; and/or templateName ending in _amp. This is only true for specific forum pages.

      If all of these are true for a given request, then the response will be in AMP-mode. If one or more is false, then the response will not be AMP-mode.

      This test will be performed in the next build of VaultWiki 4.1.x. If AMP-mode is active, wiki-related Javascript tags will not appear in the output.
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    6. August 7, 2019 #6
      mazzly
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      mazzly is offline
      Junior Member
      Join Date
      July 26, 2019
      Posts
      8
      Rep Power
      0
      Hmm I can't find that file in XF root. (It is XF1.5)

      is VaultWiki 4.1.x also available for XF1.5?
      Reply With Quote Reply With Quote

    7. August 7, 2019 #7
      pegasus
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      pegasus is offline
      VaultWiki Team
      Join Date
      March 28, 2004
      Location
      New York, NY
      Posts
      2,959
      Blog Entries
      18
      Rep Power
      688
      For XF1.5 the file would be view/global/xf.php which extends view/global/vw.php

      4.1.x is available for XF 1.2-1.5.
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    Similar Threads

    1. Group pages here on vaultwiki.org
      By jame54 in forum General Discussion
      Replies: 0
      Last Post: March 9, 2018, 1:19 AM
    2. Vaultwiki Boxes at the top of pages
      By alpha in forum VaultWiki Questions
      Replies: 1
      Last Post: July 1, 2013, 10:10 PM
    3. Add 'New pages' and 'New pages' content to wiki front page
      By basketmen in forum VaultWiki Questions
      Replies: 6
      Last Post: July 20, 2011, 10:55 PM
    4. Group pages here on vaultwiki.org
      By hollosch in forum General Discussion
      Replies: 2
      Last Post: March 19, 2010, 8:31 PM
    5. Anyone have VaultWiki Lite installed?
      By Rand al'Thor in forum Pre-Sales Questions
      Replies: 0
      Last Post: November 11, 2008, 7:10 PM

    Tags for this Thread

    bugs, pages

    View Tag Cloud

    Bookmarks

    Bookmarks
    • Submit to Digg Digg
    • Submit to del.icio.us del.icio.us
    • Submit to StumbleUpon StumbleUpon
    • Submit to Google Google

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  
    • BB code is On
    • Smilies are On
    • [IMG] code is Off
    • [VIDEO] code is
    • HTML code is Off

    Forum Rules

    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 6:39 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.