![]() Add Javascript or CSS to specific pages and paths.Add a class to a specific page for better theming.I’ll explain and demonstrate these hooks and how you can use them to: An alter or build hook is something that’s run before the page renders so you can do things such as adding JS or CSS to specific pages or content types. In turn you can use the resulting class in your Sass or CSS. For example, you can define a body class variable. Template preprocessing is a means to define variables for use within your page. We’ll also take a look at creating a variable for an array of content types. We’ll use the arg() function which returns parts of a current Drupal URL path and some pattern matching for instances when you want to match a pattern in a URL. We’ll cover template preprocessing and alter hooks using path patterns, types and args(). In this article, we’ll discuss how you can leverage various Drupal API functions to achieve more fine grained theming. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |