This may have been requested in the past but I thought I would request it anyway.
I have always found it a bit odd that there is nothing available via the API to determine whether a page actually exists.
Many times I have found myself sticking a DataFactory.Instance.GetPage call within a try catch block to check whether a PageNotFoundException occurs.
I have worked on projects that have page list properties which link to other pages in the site. Some of the pages that these properties refer to may be deleted for some reason and potentially cause the page to fall over, to cope with this I would use the try catch method above.
Would it not be possible to add a method to the DataFactory.Instance class named PageExists or something similar which accepts a page reference and returns a boolean? I know throwing and catching exceptions can be expensive and it just seems a bit unnecessary to me.
Hi
This may have been requested in the past but I thought I would request it anyway.
I have always found it a bit odd that there is nothing available via the API to determine whether a page actually exists.
Many times I have found myself sticking a DataFactory.Instance.GetPage call within a try catch block to check whether a PageNotFoundException occurs.
I have worked on projects that have page list properties which link to other pages in the site. Some of the pages that these properties refer to may be deleted for some reason and potentially cause the page to fall over, to cope with this I would use the try catch method above.
Would it not be possible to add a method to the DataFactory.Instance class named PageExists or something similar which accepts a page reference and returns a boolean? I know throwing and catching exceptions can be expensive and it just seems a bit unnecessary to me.
Regards
Lee