Jump to content

Featured Replies

Posted

I am working on a Pages template and I want to get the URL of a record of another database.

To get the URL of the current database I am using this code:

{{$url = \IPS\Http\Url::internal( "app=cms&module=pages&controller=page&path=" . \IPS\cms\Pages\Page::loadByDatabaseId( $record->database()->id )->full_path, 'front', 'content_page_path' );}}

And how to get the URL of a record from another database using the record primary id field?

Say your other database ID is 7 an the record primary id is 50.

{{$url = \IPS\cms\Records7::load( 50 )->url()}}

 

  • Author

Thanks!

cat puss GIF