Templates and themes go ahead and move this magnifier um so I’m sure all of you are aware of that and the theme of your theme is responsible for your look and feel right and a theme really all the theme is just a collection of similar templates or templates that look well together and play nice together right so it wouldn’t make sense to really have a page template and then have a region template that doesn’t fit with that page template right it doesn’t it just doesn’t make sense you could but why would you do that and one thing that is brand new with Apex 5 so if you, if you’ve worked with Apex 42 or below this, is brand new so when you create an application that has a theme or when you pick your theme for your application it has to have one um it’s actually your the theme is copied to your application and that from the repository and it is also subscribed so in other words’ apex originally didn’t do this and they originally did not subscribe to the repository theme.
They just made copies into your applications and you are responsible for setting up your own subscriptions now to be fair you still should do that in other words you still should make a shared component master and then make it that and you could make a shared component master application and have it use the universal theme and then you could unsubscribe that theme from the repository and then you can control all of your applications from that shared component master and that’s still something that you should do templates really they just we’ve taken a peek at them before really this they just contain HTML and substitution strings and those substitution strings are how we can inject data or values into your template into your templates at runtime, so a substitution string might be something like a region title Oh gran the asked you unsubscribe from what so you when you create an application let me just open up my application here and actually I need to go to a universal theme application.
So I need to go to an application that leverages the universal theme let me go to the application builder or rather that I created an apex 5 instances and let me go to the scratchpad that I have been using and if I go to my shared components and I try to pick a template I’m going to go into a template I’m going to pick one once it loads and liquid Assessor says subscribed from and all of these have a subscribed form it says theme so what this means is that if I click on one of these it says here this template is subscribed to the corresponding template in the master theme so to modify this template you can either edit the master template and then refresh the theme alternatively you can create a local unsubscribed copy of this template unsubscribed templates are editable and will not get overwritten by the theme refresh so in other words if you want to make a change to a theme or a template.
You have to either copy it or come over here and click on unsubscribe apex 42 did not have that restriction in fact apex 42 and below even if your theme was subscribed you can make a change and override it they decided that they don’t want to go that route anymore and they’re going to implement essentially a template locking mechanism to where if a template is subscribed we’re going to lock that template so you cannot change it yeah the repository version exactly so what you yeah so what I would recommend that you do and is I would still want to create a shared component master application and then I would unsubscribe that one you’re everything if in your shared component master application from the repository version of the universal theme and then all of your applications instead just subscribe to the shared component version theme and why would you do that well that’s because um you can just modify.
And the shared component the theme in your shared component master it’s much more or I don’t even know how you would go about trying to modify the repository definition of the theme I don’t really think you can and if there is I seem kind of hack to me does that make sense, huh, and the idea here is that there are many types of templates ranging from something and kind of as large as a page to as small as a button so themes and templates are responsible for the look and feel look and feel of pretty much everything so you can switch themes and um that’s actually something that is not as common any more I included it here just because it’s still a feature and really if you want to switch to the universal theme from does anybody currently have any applications that do not have are not leveraging the universal theme raise your hand if you have an application that isn’t using the universal theme that you’re supporting that’s okay, so that was obviously an applicant art.
I’m going to assume that that application was created before pre apex 50 yep exactly yeah typically when you have an application and created before apex 5 well obviously if it’s created before apex 5 you’re not using the universal theme and I guess it still is possible to not use it even after apex 5 so the only reason why I’m covering this is so that you can switch F from your previous theme to the universal theme and so we actually have an application here that we just used in the tabular forms and I’m actually going to go back to that application and we’re going to simulate kind of upgrading this thing to apex 5 let me find my tabular form example here and I need to switch teams I don’t want this blue theme any more I want to be universal so how do we do it well what we can do is to go into shared components I’m going to go into themes notice that it currently is using productivity applications and we’re actually going to create the universal theme in our metadata.
So I’m going to say create we’re going to say whew we could say as a copy from another application, so this would be great absolutely great if we had a shared component master so let me say that say as a copy from another application and what I can do is I can pick my application shared component master and I want to grab the universal theme I still I should be able to still leave it as theme 42 I want to subscribe to this theme absolutely yes oh it’s going to make me pick something I’ll whatever I’ll see 101 it’s going to take a second it’s copying my theme and subscribing to it and so now what I can do is I can actually go ahead and say switch theme I’m going to switch to this universal theme and I’m going to switch from productivity applications to my universal theme okay now this is important when you switch and the default here is reset fixed region positions and there’s also this other one here says reset all region regions and item grid settings what this is saying is that previously.
It was possible to have or the universal theme by default does not like to have more than three items in a row horizontally so in other words and doesn’t like to have if I had an item here then item here so, in other words, it doesn’t like to have more than three if your application has more than as four or more items in a row horizontally and pecs are going to bark at you and not let you switch themes well what you can do if you are willing to have I mean it if you don’t want to go back through your app application and try to find where you have rows of four or more and you can just say I want you to reset all-region and grid item settings, in other words, everything’s going to display all forms all regions are going to display one on top of the other that make sense any questions on that part.