I'm trying to figure out how I can obtain the thread ID from a custom class. This is something that is likely fairly easy, but I'm still very new to Xenforo and am learning. I searched around Google and the forums here and haven't been able to find anything useful. I see a lot of how to reference it in templates, but I need the ID in the class.
I have this in my templates
<xf:callback class="\CTM\Misc\MyTags" method="getTags"></xf:callback>
And here's my class
It works fine as-is, but I want to return some properties based on the thread ID. Other than trying to parse it from the request string, are there any other variable references I can use?
Edit: I also tried adding a parameter to the function and callback, but it's not helping either.
<xf:callback class="\CTM\Misc\MyTags" method="getTags" params="['{$thread.thread_id}']" ></xf:callback>
Edit2: I should add that I'm in the metadata_macros template
I have this in my templates
<xf:callback class="\CTM\Misc\MyTags" method="getTags"></xf:callback>
And here's my class
Code:
<?php
namespace CTM\Misc;
class MyTags {
public static function getTags() {
return "<meta name='test' value='test'>";
}
}
?>
It works fine as-is, but I want to return some properties based on the thread ID. Other than trying to parse it from the request string, are there any other variable references I can use?
Edit: I also tried adding a parameter to the function and callback, but it's not helping either.
<xf:callback class="\CTM\Misc\MyTags" method="getTags" params="['{$thread.thread_id}']" ></xf:callback>
Edit2: I should add that I'm in the metadata_macros template
Last edited: