Rock U - Rock Fundamentals - Note Types
Transcribed Video Content
Okay. So let's talk about note types. Now, we've already looked at note types as how they relate to the person, and the person detail page and that's a very common use for note types. But actually you can put note types on just about anything in Rock and I kind of want to unpack that for you because it can be pretty powerful. So let's just take a couple scenarios.
Let's just say, the finance team comes to you and says, hey, I'd to keep notes on batches. We just wanna track some discussion back and forth on a specific batch or be able to put in a little note on there. It does have a a notes property, but if you wanna add a whole bunch of notes with different people providing those notes, it might be nice to have the note blocks there. So let's go over and look at the batches screen. Now specifically, we'd want to put it on the batch detail screen, let's go ahead and look at a specific batch.
And we see that we see the batch detail above it, the transactions, and let's just say we want to add our notes, maybe somewhere in between the details here and the transactions. So, let's first, go add a new note type for batches and then we'll come back and add our block here. So we do that under admin tools, system settings, and then we just look for the note types. And when you come in here, you're gonna see note types are already, been defined, out of the box. And what we're gonna do is we're just gonna add a new different, type of note type.
So let's go ahead and hit the plus. Our name will just be batch note. The entity type will be financial batch. Now here we have two other options on how we want to control the styling. So the icon CSS class will be a little bit of an icon next to the note.
And so, for instance, here I'm just gonna put FA FA archive because I know that that's the same font that's used on financial batches. In that appearance icon class, I can give it a class name here and that allows me to style it differently in my CSS. So if I want to change its color, or anything about the styling of that note, I can give a little bit of a styling hook right here. A user selectable, we want that to be yes and that is default and that allows people to select those, to delete them, to edit them. Otherwise, they're more system notes that are provided, automatically by the system and the person really can't, mess with it.
So let's go ahead and save that And we now have our new note type for batches. So now, heading back back over to the batch page where we wanna add, the block. We'll just go ahead and look at our zone and open up the main zone. And here we're gonna add, one block. Okay.
So it's under core and it's called notes. Go ahead and hit save. Now I I kind of said in my use case here, actually wanted these notes to be before the transaction list. So I'm just gonna bring that up, hit done. Page will reload and we'll have to hit those block settings because right now, that note block doesn't quite know what type of entity it should be looking for.
So here, we can provide a heading for it. So let's just give it a nice heading, batch notes. There'll be a icon up in the heading too if we if we want. So I'm just gonna keep the sticky note. I think that that's a good one.
Tons of other different options here. This display type, it can either be a full note or there's a lighter version of the note control. Full notes generally what you want. But down at the bottom is where we pick the entity type again. Okay?
So let's pick financial batch. Now note here too, above we could pick specific note types. If I don't pick any, it's just gonna use all the note types for this entity. But sometimes we may wanna be more, exclusive than that and this allows us to actually pick a specific type of note type. For example, if I had different note types for a financial batch.
So let's go ahead and hit save and reload our page. Okay. And there we go. Now we have notes that we can put on batches. And again, the way notes work is this note applies only to this batch.
This is batch ID number 267. And if I were to go back out to the batch list and go to a different batch, I would have different notes. Okay. So this was kind of a simple use case. Let's look at something that's maybe just a little bit more complex.
So, in general, when you're looking at a page in in Rock, certain pages have what is called a context. And context just means, does the page know what's happening on, its page? So, this case, this is a batch detail. So, the context context is a batch detail. So sometimes Rock knows what its context is and sometimes you need to configure that.
Now in the batch, example here, it was already configured for you. But I wanted to show you a more full example, when that's not the case. So let's just say, that for your use case that for event registrations, you would to have, notes on a specific, instance. So say on baptism event registration instances, you wanna keep some notes there. Let's first just go ahead and add an instance.
So we'll call it maybe April baptisms. Okay. So you wanna have notes about this so you can kinda keep track of what's going on within these registrations. So the first thing again is to go back under system settings and add our note type for registration instances. So we'll just call it registration notes and that will be a registration instance.
And let's give it the icon of FA FA clipboard. Okay. So now we have our note type. So now we head back over to that page, go to our registration instance. And again, we'll do the same thing that we did before.
So I'm gonna go ahead and add that block. And that block again is under the core category and It's called notes. And I think this time I'll just keep it down below here. Okay. So if you remember back, next step is to look at the block settings.
Okay. So we'll just put registration notes and pick our entity type. Again, it's registration instance. Okay. So if we remember back to our batch example, we are pretty much done at this point.
But notice, Rock is still saying, don't know what to do here. And that's because it doesn't know how to hook in what registration ID it should be tied to this note. So let's look at the page settings and this is where we need to do a little bit of configuration on context. And that is under advanced settings. Okay.
So here it's basically saying, hey, there's a block on this page that has something to do with context. You wanna kinda clue me in on on what that is. So what we need to do is provide it the URL parameter that tells it what ID the registration instance is so they can tie the note to that. So a lot of times you can come up here and look at the URL and let's say registration instance ID equals two. This one has a nice route.
So I'll just look in the page right above it and it kind of gives me the key right there. Otherwise, I could copy and paste that from my URL. So I'm gonna paste that right in there, registration instance ID and hit save. Okay. So now my notes are all wired up and we're all ready to go.
So in some cases, you'll find that when you want to add these note blocks, the context is already known on the page, but in other times you'll need to wire it up yourself. But the key is wherever you see a page in Rock that ends with a registration instance ID and it provides a number, you can know that you can pretty much in all those cases add a note block to it, and keep custom notes, for those types. And that's how you extend note types.