0

I want to get the node number (nid) for the node which is set for 403 and 404 pages in drupal configuration system. Can you please help me for this ?

1

You need to use

variable_get('site_403');
variable_get('site_404');

It will return a string like "node/1", then you just have to parse this string to get back the node ID.

| improve this answer | |
0

You don't mention if this is via code or just admin screens. Through the admin screens you can view/edit what page is set for the 403 and 404 pages:

"Configuration > System > Site information"

| improve this answer | |
0

Thanks all for answering this, I tried this

global $conf;
print_r($conf['site_403']);

It is working fine.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.