The is_front variable was moved from _template_preprocess_default_variables() to template_preprocess_page() (see #2370147: Move is_front variable to template_preprocess_page()). This isn't very helpful for other theme hooks that may also be on the front page (which could be anything).

Unfortunately, this cannot yet be done until a proper "front" cache context is created in core or if core suddenly allows themes to create services (either directly or via a sub-module).

Comments

markcarver created an issue. See original summary.

markhalliwell’s picture

  • markcarver committed 488f262 on 8.x-3.x
    Issue #2829585 by markcarver: Add the "is_front" variable back to all...
markhalliwell’s picture

Status: Postponed » Fixed

This now ensures that all templates have an is_front variable available (so templates that implement it don't error out).

It should be noted, however, that if there is no cache_context.url.path.is_front service defined, the variable value will always be FALSE.

It is recommended to apply the patch in #2829588: Provide a "url.path.is_front" cache context to allow contributed themes to move global "is_front" variable back to get this variable working properly.

  • markcarver committed ab11468 on 8.x-3.x
    Documentation clarification
    
    Issue #2829585 by markcarver: Add the "...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.