13 Search (Rock Settings/Rock Shop) Shared by Tony Visconti, College Church 2 years ago 12.4 Administration / Finance Beginner What This recipe will show you how to: Add a search box to any Rock Settings page that filters down the list of child pages as you type Create a page for quickly viewing and searching all setting pages Sort Setting Child Page links alphabetically by running a small SQL update statement Add a search box to the Rock Shop Why It is not immediately clear what settings are found under what pages. Navigating to a setting page can also be difficult because the child pages are not sorted in alphabetical order. Implementing this recipe will save time/clicks especially for new admins in Rock. How 1. Adding a search box to a Rock Settings page Here is what we are going to create: When you start typing in the search box any page whose name does not contain the search term will disappear. For example just these two pages are left to click on after I type the search term "Tag". Setup Navigate to a Settings page such as the "CMS Configuration" page.Edit the Page Menu block on the page update the Template field with the code here: https://pastebin.com/yZZ0izmX Note: As an alternative to step 2 above, you could upload the template code to a lava file on your webserver and use an include statement that references the file. For simplicity of steps I went with instructions on how to simply copy the code directly into Template field.I added a lava file called "org_yourchurchname_PageListAsBlocks" at this path: C:\inetpub\wwwroot\Themes\Rock\Assets\Lava on my webserver when I set this up. 2. Create an All Rock Settings page Here is what we are going to create:This page will have a panel for each child page under Admin Tools. SetupUnder the Rock Settings Page add a child page called "All Settings". Add a Page Menu block to the page.Set Number of Levels setting to 2 in your Page Menu block Change the Template field setting in your Page Menu block with this code: https://pastebin.com/n0jBY3ySSet the Root Page setting in your Page Menu block to "Rock Settings". Note: As an alternative to step 2 above, you could upload the template code to a lava file on your webserver and use an include statement that references the file. For simplicity of steps I went with instructions on how to simply copy the code directly into Template field.I added a lava file called "_org_yourchurchname_PageListAsBlocksDepthTwo" at this path: C:\inetpub\wwwroot\Themes\Rock\Assets\Lava on my webserver when I set this up.3. Sort Setting Child Page links alphabetically on all Setting PagesThis can be quickly accomplished by running an update SQL statement via SSMS or the SQL Command page under Power Tools.After clearing the cache the pages on each setting page will show up in Alphabetical order.4. Bonus Search Rock Shop This same pattern can be applied to other areas of Rock such as the rock shop promo results. All we are doing is adding a little jquery to limit a set of elements on a page. As long as you can load a page with all the elements you want to search (i.e. without paging) this pattern can be applied. Here is what it looks like in the Rock shop:Update the Featured Promos block to show all promosUpdate the lava template for the Featured Promos block with this template: https://pastebin.com/v6bjyXB8This template has ja couple differences from template featured above to add search to the a rock setting page. The first difference is that we are using a different selector for our jquery filter function on line 24: The second difference is a change to the last line.This line includes the original lava that builds the promo results we intend to filter.Follow Up Please don't hesitate to leave a comment or message me on Rocket Chat (@tony.visconti) if you have questions or find any issues with this recipe.The Rock community site doesn't currently notify recipe authors when you comment below. Change Log ~2022-01 Initial Version ~2022-07-28 Add another example of how this search pattern can be used on the Rock Shop page.~2022-09-18 Simplified instructions for updating the template field on referenced page menu blocks. Download File