if in webapp, i want to delete some elements as early as possible,
how and where should i do.
i think hook_page_alter seems too late.i want it to be early.
thanks.

can some one tell us how to do it or give us a link.
thanks.

Comments

manish2184’s picture

Use THEME_NAME_block_list_alter(&$blocks) to disabled some blocks for certain urls. Also you can use hook_preprocess_HOOK and modify
$vars['page'] to alter page elements.

qqboy’s picture

could i know which is the earliest?
also to alter blocks
then hook_preprocess_block then filter by block id ?
hook_page_alter seems very late, as last step before finally rendering.

thank you very much.
marvelous,good,nice,wonderful,gorgeous,excellent,excellent,fabulous,inspiring,interesting...

Jaypan’s picture

It really depends on what you are trying to delete. Different items have different hooks called on them at different times.