# CMS Preview Next and New Random Buttons

**URL:** <https://forums.realmacsoftware.com/t/cms-preview-next-and-new-random-buttons/57396>\
**Category:** Elements CMS\
**Created:** [August 20, 2026, 4:17pm UTC](https://forums.realmacsoftware.com/t/cms-preview-next-and-new-random-buttons/57396 "2026-08-20T16:17:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichaelDroste](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/michaeldroste/32/37212_2.png) [@MichaelDroste](https://forums.realmacsoftware.com/u/MichaelDroste)\
**Post date:** [August 20, 2026, 4:17pm UTC](https://forums.realmacsoftware.com/t/cms-preview-next-and-new-random-buttons/57396/1 "2026-08-20T16:17:01Z")

</div>

Wanted a random button - added to default - you can turn it off in the inspector - just a fun way for a visitor to explore cms content

 ![Screenshot 2026-08-20 at 10.34.13 AM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/0/4/0447bc041d7c4b24b2c95c3cb850100d1750fe5c.png)

 ![Screenshot 2026-08-20 at 10.33.57 AM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/8/d/8d52cc29268094ab7f1ca0930f56434442e3f59d.png)

Hope you like it 🙂  
-mike

> **[Dropbox](https://www.dropbox.com/scl/fi/yc6xlj9uqjzl8vrj9l974/CMS-Prev-Next.elementsdevpack.zip?rlkey=t9fsuy3idxg7jqh7l2gvhfzlg&st=03v7y706&dl=0)**

---

<div class="post-metadata">

**Author:** ![MichaelDroste](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/michaeldroste/32/37212_2.png) [@MichaelDroste](https://forums.realmacsoftware.com/u/MichaelDroste)\
**Post date:** [August 20, 2026, 4:47pm UTC](https://forums.realmacsoftware.com/t/cms-preview-next-and-new-random-buttons/57396/2 "2026-08-20T16:47:40Z")

</div>

Live for preview:

> **[One Song Every Day Complete Daily Music Project Archive](http://onesongeveryday.com)**
>
> Explore the songs of the One Song Every Day Project, a daily music archive featuring original compositions across jazz, ambient, rock, electronic, classical, world, and experimental styles. Stream, listen, and discover the first chapter of a 365-day...

> **[Technitrox | Technology Blog for News, Reviews & How-Tos](http://technitrox.com)**
>
> Technitrox | Technology Blog for News, Reviews & How-Tos - Technitrox is your trusted source for technology news, gadget reviews, software tutorials, AI insights, cybersecurity tips, and digital trends. Explore in-depth guides and expert commentary...

> **[Windy Town | Music Recording, Mixing, Mastering & Multimedia Studio Since 1980s](http://windytown.com)**
>
> Professional music recording, mixing, mastering, video, and iOS-integrated production. Work remotely or in-studio with Windy Town — sonic perfection since the 1980s.

> **[Trumpet Lessons, Free Sheet Music & Gear Tips | TrumpetStudio.com](https://www.trumpetstudio.com/)**
>
> Master the trumpet at every level. Free sheet music, expert lessons, gear tips, and practice tools—everything you need to play smarter, stronger, better.

Just a side note: when I made [OneSongEveryDay.com](http://OneSongEveryDay.com)  
I had wanted to have each on a separate page and previous next and random buttons in 2007 - but at that time it was beyond my knowledge and web skills - not to mention doing a song per day left little time for web development… it was originally one long page with mp3 link at end of song explanation…

So I’m grateful to Realmac for finally 19 years later getting what I wanted in 2007 🙂

---

<div class="post-metadata">

**Author:** ![PouwelW](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@PouwelW](https://forums.realmacsoftware.com/u/PouwelW)\
**Post date:** [September 7, 2026, 12:14pm UTC](https://forums.realmacsoftware.com/t/cms-preview-next-and-new-random-buttons/57396/3 "2026-09-07T12:14:17Z")

</div>

Hi @MichaelDroste. I suppose this is the next version of your Prev/Next Dev Pack, with a Random Button added? It’s a nice addition indeed. I use an older version without “Random” and I like it. 😀 On my homepage I show the most recent posts. I filter the collection by “Featured”, although I would prefer filtering by date. But anyhow, your buttons work exactly as you would expect. No not featured posts are shown.

But I’ve also got a page where I show only posts with the same tag. I misuse tags, because categories still don’t seem to have any function in Elements. So I filter the collection by tag. In this case the Prev/Next button doesn’t take the filtering by tag in account. Readers also view posts beyond the category (tag) they want. Any chance you might make filtering by tag possible too?

---

<div class="post-metadata">

**Author:** ![MichaelDroste](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/michaeldroste/32/37212_2.png) [@MichaelDroste](https://forums.realmacsoftware.com/u/MichaelDroste)\
**Post date:** [September 7, 2026, 2:58pm UTC](https://forums.realmacsoftware.com/t/cms-preview-next-and-new-random-buttons/57396/4 "2026-09-07T14:58:26Z")

</div>

An option:  
create a new frontmatter  
Featured - true / false

When you want to feature a post change to true

Here’s the tricky part

Create a SECOND ‘template’ above your first one - this is for Featured Posts ONLY

I’ll post a picture when I get to the computer…

I wanted seasonal songs on top for Christmas and other events at [WindyTown.com](http://WindyTown.com)

Also take a look at my search engine on [WindyTown.com](http://WindyTown.com) I think it’s what you want…

---

<div class="post-metadata">

**Author:** ![MichaelDroste](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/michaeldroste/32/37212_2.png) [@MichaelDroste](https://forums.realmacsoftware.com/u/MichaelDroste)\
**Post date:** [September 7, 2026, 3:03pm UTC](https://forums.realmacsoftware.com/t/cms-preview-next-and-new-random-buttons/57396/5 "2026-09-07T15:03:13Z")

</div>

> **[Releases · michaeldroste/previous-next-random-buttons](https://github.com/michaeldroste/previous-next-random-buttons/releases/)**
>
> Simple easy insertion that creates previous-next-random buttons for Elements Software CMS - michaeldroste/previous-next-random-buttons

 ![Screenshot 2026-09-07 at 10.13.49 AM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/5/2/522e24342e3c8541cc1f0f564f9c5efc649ca926.jpeg)

 ![Screenshot 2026-09-07 at 10.14.30 AM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/8/4/84af4c9cb5ac4e1781a0498373551e19ed57a072.png)

 ![Screenshot 2026-09-07 at 10.15.15 AM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/7/9/795f2f67ffdad057dd0d2fd65cb22c5785aea661.png)

---

<div class="post-metadata">

**Author:** ![PouwelW](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@PouwelW](https://forums.realmacsoftware.com/u/PouwelW)\
**Post date:** [September 8, 2026, 1:24pm UTC](https://forums.realmacsoftware.com/t/cms-preview-next-and-new-random-buttons/57396/6 "2026-09-08T13:24:36Z")

</div>

I’m grateful for all your help. I’m using the featured frontmatter already. I’m using this to distinguish between newer and older posts, because filtering by date is impossible. On my homepage I only show the featured posts.

Other pages are dedicated to posts with a specific tag. There I want to show both featured and non featured posts, but only posts with that tag. Filtering by tag works as expected on these pages. But when I view a post page the previous/next button doesn’t stay within the range of the filtered posts.

I’m starting to understand what you write, but don’t understand what you mean by “a SECOND ‘template’ above the first one”. Could you explain this further? I looked at Windy Town. I think you’re right about your search engine. In stead of a table I use cards on the main page.

Maybe you can take a look? The page is in Dutch: [https://thuismonnik.nl/weblog/](https://thuismonnik.nl/weblog/). If you scroll down you see the cards. Choose the card called “Gebed”. It will take you to this page: [https://thuismonnik.nl/weblog/gebed/](https://thuismonnik.nl/weblog/gebed/). This is the page with the collection filtered by tag. As you see there are only three posts with tag “gebed”. I show these posts on a post page which used to show only a leftwards back arrow. I would like to replace this with your previous/next button. I added your button for now, so you can see that it shows posts out of range.

I hope this helps clearing my problem and of course I hope, that you have a wonderful solution. 😉

---

<div class="post-metadata">

**Author:** ![MichaelDroste](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/michaeldroste/32/37212_2.png) [@MichaelDroste](https://forums.realmacsoftware.com/u/MichaelDroste)\
**Post date:** [September 8, 2026, 1:58pm UTC](https://forums.realmacsoftware.com/t/cms-preview-next-and-new-random-buttons/57396/7 "2026-09-08T13:58:26Z")

</div>

(2) collections from Elements

(1) Featured Only Collection

(2) Regular usage Collection

Stack them on top of each other - featured first then regular

When you turn on featured - it will show up on top!

(See my picture above)

---

<div class="post-metadata">

**Author:** ![MichaelDroste](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/michaeldroste/32/37212_2.png) [@MichaelDroste](https://forums.realmacsoftware.com/u/MichaelDroste)\
**Post date:** [September 8, 2026, 2:19pm UTC](https://forums.realmacsoftware.com/t/cms-preview-next-and-new-random-buttons/57396/8 "2026-09-08T14:19:29Z")

</div>

I’d change your layout in mobile

 ![IMG_2499](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/6/6/66ac9f2271813ae10b62345ec25444fed1b9429a.jpeg)

---

<div class="post-metadata">

**Author:** ![PouwelW](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@PouwelW](https://forums.realmacsoftware.com/u/PouwelW)\
**Post date:** [September 10, 2026, 12:23pm UTC](https://forums.realmacsoftware.com/t/cms-preview-next-and-new-random-buttons/57396/9 "2026-09-10T12:23:08Z")

</div>

I’m afraid I still don’t get it. But I’m heading in another direction now using the _Search component_. Your search engine on [WindyTown.com](http://WindyTown.com) looks indeed like the right path to choose, or maybe the upcoming _Tag list component_.

Can I ask you something about your search list implementation? I realize it may be a lot to ask from you.

1. How did you manage to transform the results in working links? Do I have to do all the coding described in the _Pretty URL_ section of the CMS documentation? Because, if so, I’m afraid that is too complicated for me.
2. I want to search for posts with a specific tag. So the search engine should look at the tags only. This seems to be the same as the searching by genre which you implemented. How did you do that? In my case the tag could also be a word I use in the body of certain posts.
3. You provide a list of clickable music genres which then become the search term for the _Search component_. How did you implement that? Coding?

Unfortunately your prev/next button in combination with the search list has got the same problem I described in my first post on this topic. They reach beyond the selected titles from the search results. I searched for Jazz titles, found three trilogies, but on the page with Trilogy 3 the Next button still works and brings me to _She’s got the Looks._

---

<div class="post-metadata">

**Author:** ![MichaelDroste](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/michaeldroste/32/37212_2.png) [@MichaelDroste](https://forums.realmacsoftware.com/u/MichaelDroste)\
**Post date:** [September 10, 2026, 6:14pm UTC](https://forums.realmacsoftware.com/t/cms-preview-next-and-new-random-buttons/57396/10 "2026-09-10T18:14:17Z")

</div>

This is how I did it - Claude came up with the code

It’s like a link but different - select plain text and add #

LOOK at the picture and set it EXACTLY the same

CHANGE value=‘pop/rock’ ---- **pop/rock** to your content name FOR EACH SEARCH TERM

```auto
document.getElementById('genre-search').querySelector('input').value='pop/rock'; document.getElementById('genre-search').querySelector('input').dispatchEvent(new Event('input',{bubbles:true}))

```

 ![Screenshot 2026-09-10 at 1.08.45 PM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/8/d/8d7da439a9deb350fe0ada987c7ce94d62270f59.webp)
