Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted March 3Mar 3 Hi,I have a Database with custom templates and I used to use "{{$item = \IPS\forums\Topic::load( $idTopic );}}" in order to get one topic's data.Now, when I try to load this into $item, the template is not loaded and seems to fail.How are we supposed to use this methods?Cheers,Ibai
March 3Mar 3 Community Expert Solution it isn’t finding the topic probably. You should use try/catch to get a proper error message or skip in case of an error.
March 3Mar 3 Author it isn’t finding the topic probably. You should use try/catch to get a proper error message or skip in case of an error.Humm... as I restored a backup and tried to make some space, this could be the reason... So as you say, it should load the data.How can I use try/catch in this kind of template bits?Thanks Adriano!
March 3Mar 3 Community Expert How can I use try/catch in this kind of template bits?See an example with the variable $license here:
March 4Mar 4 Author See an example with the variable $license here:Oh wow, I didn't even thought of doing that super easy way! Thanks! :)