Drupal 8: Add a class to the more link of a view.
/**
* Implements template_preprocess_views_view()
/**
* Implements template_preprocess_views_view()
I ran into an issue today where I needed to get a themed views title from within a views row style template file (tpl). I tried using drupal_get_title() and menu_get_item() but the title elements were all blank for these. Next I inspected the $views object looking for the themed title but it was not listed. Finally, I discovered within $views->build_info the title and substitutions variables.
I recently ran into an issue where I wanted to use a views page as a tab for nodes of type 'course'. I added the view page like normal, providing my path of: node/%/course-list.
Next, I added my menu item entry as a 'menu tab'.
Perfect, except that the menu tab was displaying on every node when I needed it to only display on one node type.
We had a Drupal 7 site setup with a default calendar instance that was displaying content of type 'event'. Due to the limited number of events this site would promote, it was decided to change the navigation from the standard 'Next/Previous' to use drop down menus where the user could choose the month/year they wanted to view.
Today I needed to change the format of a taxonomy term exposed filter to display the vocabulary hierarchy in groups instead of the normal '-Item', '--Sub-Item' format (see the before and after photos below).
Before
|
After
|
We have a site that is running the views slideshow module to display advertisement images. Recently a client asked us to prevent these advertisements from displaying only one item on the screen. In order to do this I began dissecting the views slideshow module code and I came across the template_preprocess_views_slideshow_cycle_main_frame() function. This function takes care of rendering the rows.
Today I needed to create a view the filtered items by a range of prices. The prices for these nodes were stored in a CCK number field. After searching for an easy 'plug and play' method of doing this I quickly began writing my own code to accomplish this task. To summarize, I accomplished this by using the following functions:
Today I had the challenge of generating a view that needed to filter results based on the date/time a node was created. More specifically, I needed to filter bowling stats for a season. Easy, right? The problem I ran into is that the bowling season doesn't begin and end in the same year. So using an argument to only grab nodes created in 2011 didn't work. I needed the view to grab nodes between July, 2010 through July, 2011.