mcatze Well-known member Apr 16, 2014 #1 Is it possible to get the Version ID of an AddOn in a template e.g. as an footer copyright?
Chris D XenForo developer Staff member Apr 16, 2014 #2 I don't understand your example, but yes. {$xenAddOns.addonId} will return the add-on version ID
mcatze Well-known member Apr 16, 2014 #3 I wrote a little addon and would like to show the version id of this addon in the template, e.g. "Copyright 2014 v1.01" Can you give me a little bit more examples, i am a newbie with coding .. How can i get my addon in {$xenAddOns.addonId} ?
I wrote a little addon and would like to show the version id of this addon in the template, e.g. "Copyright 2014 v1.01" Can you give me a little bit more examples, i am a newbie with coding .. How can i get my addon in {$xenAddOns.addonId} ?
Chris D XenForo developer Staff member Apr 16, 2014 #4 When you created your add-on in the Admin CP, you gave it an add-on ID and a version string. Just use {$xenAddOns.addOnId} in the template. Replace addOnId with your add-on ID.
When you created your add-on in the Admin CP, you gave it an add-on ID and a version string. Just use {$xenAddOns.addOnId} in the template. Replace addOnId with your add-on ID.
mcatze Well-known member Apr 16, 2014 #5 This gives me the full ID like 10002. What i need is the version_string. Is there an possibility to show this?
This gives me the full ID like 10002. What i need is the version_string. Is there an possibility to show this?
Chris D XenForo developer Staff member Apr 16, 2014 #6 You asked for the version ID. No, that isn't possible unless you cache it separately, or perform a database query to get it.
You asked for the version ID. No, that isn't possible unless you cache it separately, or perform a database query to get it.
mcatze Well-known member Apr 16, 2014 #7 Yes, my fault. Wrong question, but thanks for your quick help. I take a look for a different way ..
Chris D XenForo developer Staff member Apr 16, 2014 #8 Create an option in the Admin CP assigned to your add-on. Make it only visible in Debug Mode. Populate that manually with the version string. Then you can use {$xenOptions.addOnVersion} in the template. Replace addOnVersion with whatever the option ID is. It means you have to do it manually, but unless you write some custom code it's the only way to do it.
Create an option in the Admin CP assigned to your add-on. Make it only visible in Debug Mode. Populate that manually with the version string. Then you can use {$xenOptions.addOnVersion} in the template. Replace addOnVersion with whatever the option ID is. It means you have to do it manually, but unless you write some custom code it's the only way to do it.
mcatze Well-known member Apr 16, 2014 #9 This is an great idea. I think i've seen something likes this in some addons or styles .. Thanks again. EDIT: You wrote "Make it only visible in Debug Mode". But i can't find this option. Last edited: Apr 16, 2014
This is an great idea. I think i've seen something likes this in some addons or styles .. Thanks again. EDIT: You wrote "Make it only visible in Debug Mode". But i can't find this option.
Hoffi Well-known member Oct 3, 2014 #10 You can add a group to the debug mode. Not an simple setting.