This extension allows you to use r:find with an ‘id’ attribute instead of the usual ‘path’ attribute. This way the r:find tag will stay intact even if the path of the target page changes.
An ‘ids’ attribute was also added to r:aggregate to use instead of ‘paths’.

Important benefit is that this is also much faster than finding a page by path;

    >> Benchmark.measure { Page.find(2546) }
    =>   0.000000   0.000000   0.000000 (  0.003986)

    >> Benchmark.measure { Page.find_by_path('/farm-forestry-model/species/eucalypts/growing-eucalypts-for-timber---videos-and-information/videos/') }
    =>   0.020000   0.010000   0.030000 (  0.027044)

In order to be ‘newbie friendly’, this extension also allows you to display the page IDs on admin/pages#index and/or admin/pages#edit. In order to do so, set Radiant::Config['expose_page_ids'] to any of ‘overview’, ‘detail’ or ‘both’. Any other value will hide the ID partials.

Author Benny Degezelle
Supports Radiant 1.1.4
Record Created May 1, 2016 (over 3 years ago)
Last Updated June 10, 2016 (over 3 years ago)


At the command prompt, in the root of your Radiant project, type:

script/extension install find_by_id_tag