Search

Showing 7 of 1,975 result(s)

/blog/2022/11/01/a-beginners-guide-to-antlers-arrays-and-loops#content-inserting-content-at-arbitrary-or-random-locations

…t is not an uncommon requirement to be able to insert additional content within a listing of collection entries. An example of this may be to insert an advertisement at specific locations or to randomly insert supplementary or featured content...

/blog/2021/11/07/creating-a-statamic-compact-modifier#content-interacting-with-the-context

In the previous section we generated the scaffolding for our modifier, and started the basic implementation. We left off being able to split our modifier's input into an array of variable names, but did not actually retrieve the value of those...

/blog/2020/12/29/creating-a-custom-statamic-500-server-error-page#content-testing-the-error-page

…e Tags directory will be created if it does not already exist). The command accepts the name of our new tag; in the following example ServerError is the name of our new Antlers tag (make sure to run this command from project's root directory,...

/blog/2023/09/03/creating-a-hybrid-cache-system-for-statamic#content-organization-singletons-and-facades

…om the service container registered as a singleton, we will receive the same instance back each time. Utilizing this design pattern will allow each disparate section of our codebase to use the same Manager instance and, thus, the same cache state...

/blog/2023/09/03/creating-a-hybrid-cache-system-for-statamic#content-experimenting-with-response-times

…Starting the site and refreshing a few times, the response time seems to settle at around 380 milliseconds (again, this process is just to observe some relative numbers): That's not terrible, but let's see what happens if we wrap the entirety of...

/blog/2021/12/12/creating-a-content-reaction-system-with-statamic-3-and-antlers#content-implementing-the-reaction-view-count

…want to pull the existing reaction counts from. To make things easier on ourselves, and reduce the amount of duplicate code, we are iterating a list of all valid reaction fields that could exist. Within this loop, we are using the Arr::get helper...

/blog/2022/11/01/a-beginners-guide-to-antlers-arrays-and-loops#content-accessing-arbitrary-array-ranges

In the previous section, we looked at how we can use the first and last modifiers to retrieve their individual items from an array. We can also use the limit and offset modifiers to retrieve ranges of elements from an array or a subset of the...