Daniel Hood Well-known member Licensed customer Aug 13, 2013 #1 Are the options set in the admin panel accessible through the XenForo javascript object? I tried Code: console.log(XenForo.options); but it said undefined.
Are the options set in the admin panel accessible through the XenForo javascript object? I tried Code: console.log(XenForo.options); but it said undefined.
Daniel Hood Well-known member Licensed customer Aug 13, 2013 #3 hmmm... alright. Is there a buildLink function or something I can use then? I needed options for something else but I also need to be able to build a path.
hmmm... alright. Is there a buildLink function or something I can use then? I needed options for something else but I also need to be able to build a path.
Chris D XenForo developer Staff member Licensed customer Aug 13, 2013 #4 Best thing to do is use data- attributes on HTML elements if appropriate. They're used a lot in XenForo. Mostly to pass options and other data to JavaScript functions.
Best thing to do is use data- attributes on HTML elements if appropriate. They're used a lot in XenForo. Mostly to pass options and other data to JavaScript functions.
Jeremy in memoriam 1991-2020 Licensed customer Aug 13, 2013 #5 Yup, I concur with data-attributes. They are extremely useful when it comes to storing necessary information (XenForo uses them extensively).
Yup, I concur with data-attributes. They are extremely useful when it comes to storing necessary information (XenForo uses them extensively).