D
D
Dmitry2017-07-06 15:11:29
Drupal
Dmitry, 2017-07-06 15:11:29

How to find out the id of the node that is the main page?

Hello. Tell me how to programmatically find out the id of the node, which is the main one on the site. And it is written in the site configuration field, in the settings of a specific domain, with the Domain Access module installed

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Olga Svistunova, 2017-07-21
@Sadchenko

In general, the address of the main page is stored in a variable - variable_get('site_frontpage', ''). Using the address to find out the id of the node is not difficult.
I don't know how Domain Access works, but it probably either overwrites this variable somehow or has its own. If you have the Devel module installed, view the list of variables in /devel/variable.

C
copyhold, 2017-07-06
@copyhold

https://api.drupal.org/api/drupal/includes%21path....
drupal_get_normal_path('/') => 'node/ID'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question