• Development

    Make a Field Label “visually-hidden” in Drupal 8

    Using the Form API you can add a visually-hidden class to a field using the “#title_display” property as shown here:


  • Development

    Drupal 8 Search API Tips

    Here are some quick tips for configuring Search API for Drupal 8.

    Easy Indexing

    If you’re like me you rely heavily on Display Modes (aka View Modes) for your entity types. The most convenient way to get Search API to index your data is to use the Search Index view mode on any entity types you will index. If you’re using Display Suite you may want to choose a layout that doesn’t include authoring information, published date, etc. Just fill this view mode, in each entity type, with the fields you want to index. If you plan to use this to drive the output, you should also hide labels and do whatever else will ensure clean output; more on this later.

    I suggest indexing the Title (in the case of content types) separately. More on that in the Boost notes below.