Rangers Fans Active member Sep 10, 2024 #1 nm, was using a very old reference I found using <xen instead of <xf Last edited: Sep 10, 2024
P Paul B XenForo moderator Staff member Sep 10, 2024 #2 That is not a valid tag for XF2. It is <xf:if ... . Upvote 0 Downvote
Rangers Fans Active member Sep 10, 2024 #3 Paul B said: That is not a valid tag for XF2. Click to expand... right, just noticed looking at other code n page container it's <xf, not <xen. You can delete thread if you want. Upvote 0 Downvote
Paul B said: That is not a valid tag for XF2. Click to expand... right, just noticed looking at other code n page container it's <xf, not <xen. You can delete thread if you want.
Rangers Fans Active member Sep 10, 2024 #4 Paul B said: That is not a valid tag for XF2. It is <xf:if ... . Click to expand... @Paul B I updated to this, but still not working, but now instead of being on every page, it's not scraping the OG info at all and don't see it in the page source either. Code: <xf:if is="{$thread.thread_id} == 5"> <meta property="og:title" content="" /> <meta property="og:type" content="article" /> <meta property="og:image" content="" /> <meta property="og:url" content="" /> <meta property="og:description" content="" /> </xf:if> Upvote 0 Downvote
Paul B said: That is not a valid tag for XF2. It is <xf:if ... . Click to expand... @Paul B I updated to this, but still not working, but now instead of being on every page, it's not scraping the OG info at all and don't see it in the page source either. Code: <xf:if is="{$thread.thread_id} == 5"> <meta property="og:title" content="" /> <meta property="og:type" content="article" /> <meta property="og:image" content="" /> <meta property="og:url" content="" /> <meta property="og:description" content="" /> </xf:if>
P Paul B XenForo moderator Staff member Sep 10, 2024 #5 Dump the var in the template to confirm it exists. P Identifying and using variables in templates, advertising positions, navigation entries, and widgets Sep 24, 2020 $xf.bro_guide Upvote 0 Downvote
Dump the var in the template to confirm it exists. P Identifying and using variables in templates, advertising positions, navigation entries, and widgets Sep 24, 2020 $xf.bro_guide
Rangers Fans Active member Sep 10, 2024 #6 Ok I added {{ dump($thread.thread_id)}} to the page_container template and it saved without error Upvote 0 Downvote
P Paul B XenForo moderator Staff member Sep 10, 2024 #7 What value do you see when viewing the page? Is it the thread ID or null? If it's null, dump all vars and look for one you can use. Upvote 0 Downvote
What value do you see when viewing the page? Is it the thread ID or null? If it's null, dump all vars and look for one you can use.
Rangers Fans Active member Sep 10, 2024 #8 Paul B said: What value do you see when viewing the page? Is it the thread ID or null? If it's null, dump all vars and look for one you can use. Click to expand... viewing the page itself I see null in orange letters above the staff bar. Viewing source I saw at the top data-content-key="thread-5" Upvote 0 Downvote
Paul B said: What value do you see when viewing the page? Is it the thread ID or null? If it's null, dump all vars and look for one you can use. Click to expand... viewing the page itself I see null in orange letters above the staff bar. Viewing source I saw at the top data-content-key="thread-5"
Rangers Fans Active member Sep 10, 2024 #9 Saw this in your guide, but this didn't work either and dumped as null - <xf:if is="$threadID == 2"> Upvote 0 Downvote
P Paul B XenForo moderator Staff member Sep 10, 2024 #10 See the update in the guide about passing a value to the container. Upvote 0 Downvote
Rangers Fans Active member Sep 10, 2024 #11 ok, dumping {{ dump($contentKey) }} kicks back thead-5 <xf:if is="$contentKey == 5"> still doesn't load it and <xf:if is="$contentKey == thread-5"> errors trying to save. Upvote 0 Downvote
ok, dumping {{ dump($contentKey) }} kicks back thead-5 <xf:if is="$contentKey == 5"> still doesn't load it and <xf:if is="$contentKey == thread-5"> errors trying to save.
Rangers Fans Active member Sep 10, 2024 #12 Paul B said: See the update in the guide about passing a value to the container. Click to expand... ok! Upvote 0 Downvote
Paul B said: See the update in the guide about passing a value to the container. Click to expand... ok!
Rangers Fans Active member Sep 10, 2024 #13 That worked adding that line to thread_view first! Thanks so much for the help! Upvote 0 Downvote
Rangers Fans Active member Sep 10, 2024 #14 Reference for anyone else trying to achieve a different OG to a certain thread First in thread_view add Code: <xf:page option="threadID">{$thread.thread_id}</xf:page> then in page_container between <head> and </head> add Code: <xf:if is="$threadID == xxx"> <meta property="og:title" content="" /> <meta property="og:type" content="article" /> <meta property="og:image" content="" /> <meta property="og:url" content="" /> <meta property="og:description" content="" /> </xf:if> and then lastly go to https://developers.facebook.com/tools/debug/ and put in the URL of your thread to get a FB scrape update to share the thread. Upvote 0 Downvote
Reference for anyone else trying to achieve a different OG to a certain thread First in thread_view add Code: <xf:page option="threadID">{$thread.thread_id}</xf:page> then in page_container between <head> and </head> add Code: <xf:if is="$threadID == xxx"> <meta property="og:title" content="" /> <meta property="og:type" content="article" /> <meta property="og:image" content="" /> <meta property="og:url" content="" /> <meta property="og:description" content="" /> </xf:if> and then lastly go to https://developers.facebook.com/tools/debug/ and put in the URL of your thread to get a FB scrape update to share the thread.