Lessons: 27Length: 2.1 hours

Next lesson playing in 5 seconds

Cancel
  • Overview
  • Transcript

5.5 Template Customization

Cycle uses regular expressions for template tokenization. What does this mean? Well, remember those placeholders which used double curly braces and would output information about slides? You can change those to pretty much whatever you want. Let’s see an example.

5.5 Template Customization

Cycle uses irregular expressions for template tokenization. Now what does that mean? Well remember those placeholder that you used double curly braces that you use for captions for example, and with output information about the slider or the slides themselves. Well you can very easily change those to whatever you want. So let's see a very quick example. Here we have a very simple sideshow with a custom caption template. Now the caption template looks like this. Now so we're displaying slight numbers like count, some parameters or attributes from the images like the old and title and also some custom metadata. Now these are the placeholders I was talking about in the intro of this video. And let's say for example you don't like these double curly braces and you wanna change them to double stars, for example. Well that's actually really easy to do just do that up. Cycle TMPL rejects and you would pass in a regular expression here. That looks something like this. Now personally I'm not a big fan of regular expressions. I'm not very good at using regular expressions. But essentially using this allows you to change these brackets to double stars and of course, do the same for the closing ones. All right, so you'll see that the slide show is still functional, that caption is still displaying all the information it needs to, but this time using our own format. And I'm going to end the lesson here. We're not going to go over a regular expression how to use it, there are a bunch of tutorials on the web about this. So if you're interested in it, go ahead and check it out. I'm pretty sure no one will bother changing these, but just in case you want the option. It's there. And that was a very quick look at template customization. Now with that we've finished the course. I really hope you enjoyed it. Please join me in the next lesson for the conclusion.

Back to the top