Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted June 26, 20168 yr If I want to call a record id I use the following.. \IPS\Request::i()->id == x I want to go one step further and call a record id from x database.. I tried the following but it did not work.. \IPS\Request::i()->database_id == x and \IPS\Request::i()->id == x What can I use?
June 27, 20168 yr Author I've tried different combinations too, including below, and none worked. $category->_id == 'x' In all cases I can call up the record id, but not the database id. What am I missing?
June 28, 20168 yr Author I've also tried and didn't work.. $database->_id == 'x' $category->database_id == 'x' $databases->_id == 'x' $databases->databases_id == 'x' $databases->_database == 'x'
June 29, 20168 yr Author I also tried and failed $location->_id == 'x' $location->location_id == 'x' $location->database_id == 'x'
June 29, 20168 yr Try again On 26.06.2016 at 5:33 PM, GrooveOnBeat said: I want to go one step further and call a record id from x database.. How? db contain many articles. Which template you edit?
June 29, 20168 yr 13 minutes ago, GrooveOnBeat said: I edited in globalTemplate. You can't get article id when you viewing db. Maybe there is another way. Provide more info
June 29, 20168 yr Author 10 minutes ago, newbie LAC said: You can't get article id when you viewing db. Maybe there is another way. Provide more info I'd like to change content from globalTemplate based on the record I'm viewing. So record 1 will have something different from record 2 and so on. I've managed to change the content by the record id \IPS\Request::i()->id == x The conflicts come when there is another database with that same record id. So if database id 1 and id 2 have record id 3 the content will show up when viewing record id 3 from both databases. I'd like to restrict content when viewing record 3 only when it's from database id 1. I hope that helps.
June 29, 20168 yr Author 9 minutes ago, newbie LAC said: Use to define database ID \IPS\cms\Databases\Dispatcher::i()->databaseId Wow! That did the trick! I wish I could give you 1000 likes. Thank you newbie LAC once again for saving the day! \IPS\cms\Databases\Dispatcher::i()->databaseId == x
Archived
This topic is now archived and is closed to further replies.