XF 2.1 How to run two different javascript headers on different forums??

faker.king

New member
My requirement
I have 2 java script headers used to upload images into two different sites. I want to run the first script which upload images to first chevretto site on all forums except two forums AND conversation chat.
Need to run the second script which upload images to another site on those two forums AND conversation.

Below is what currently working .
Below is what I managed to achieve. First code runs on all forum including the two nodes I wanted to exclude (Wish to run second script on these 2 nodes). But managed to run the second script on the conversation pages.

Please support to exclude first script on two particular nodes (Lets say node 10 & 20) using node ID or some means and run the second script on conversation pages AND those two nodes which was excluded to run the first script.

I have tried to play with data-container-key but was not doing it right. Please help editing below working code

CSS:
<template_modifications>
  <modification type="public" template="PAGE_CONTAINER" modification_key="add_pics_to_PAGE_CONTAINER2" description="Test image upload" execution_order="10" enabled="1" action="str_replace">
    <find><![CDATA[</head>]]></find>
    <replace><![CDATA[<xf:if is="$xf.visitor.user_id AND in_array({$template}, ['forum_post_thread', 'thread_view', 'post_edit', 'forum_view', 'xfmg_media_view','member_view'])">
    <script async src="https://add.pics/sdk/pup_3.15.1.js?_v=3151"
            data-url="https://add.pics/upload"
            data-auto-insert="bbcode-embed"
            vendor="xenforo"
            data-sibling="button.button--icon--preview"
            data-sibling-pos="before">
    </script>
    <xf:else />
    <script async src="https://imgbb.com/sdk/pup.js"
            data-url="https://imgbb.com/upload"
            vendor="xenforo"
            data-sibling="button.button--icon--reply"
            data-sibling-pos="after">
    </script>

Any help will be appreciated
 
Top