Updated 017 Layout Setup (markdown)
1 parent
7e76965a72
commit
7dfb472ad9
1 file changed
+4
-3
+4
-3
@@ -10,7 +10,8 @@ What I've done, in the dynamic get I've added a little string. Since each dynami
|
||||
|
||||
**How Tempaltes Call Layouts**
|
||||
|
||||
We will open your template that calls the layout. We want to see that initial setup and one of the templates that really illustrates this very well [00:01:54](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m54s) is this sermon list. So I'm going to open sermon list. In sermon list you see that I'm looping through the items. Then I am adding some parameters to the item object.
|
||||
We will open your template that calls the layout. We want to see that initial setup and one of the templates that really illustrates this very well [00:01:54](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m54s) is this sermon list. So I'm going to open sermon list. In sermon list you see that I'm looping through the items. Then I am adding some parameters to the item object. One of them is the params, the other is I'm taking the description and making sure that it's escaped, and it is no longer than 90 characters. [00:02:26](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m26s) Then I'm adding that back to the description without the full name, and then adding that item to the 'JlayoutHelper::render(study class render)(sermonlist item)' [00:02:46](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m46s) as the layout name, and that basically is going to populate the script between the list items that is going to be placed in an unordered list on the sermon list page. Now let's go look at this specific layout 'JlayoutHelper::render(study class render)(sermonlist item)'. [00:03:15](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m15s)
|
||||
|
||||
???
|
||||
One of them is the params the other is I'm taking the description and making sure that it's escaped and no longer than 19 characters [00:02:26](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m26s) And then I'm adding that back to the description without the full name And then adding that item To the layout Study class render Layout help J layout helper study class Render [00:02:46](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m46s) sermon List item as the layout name Ok and that basically is gonna populate The Script between List items That is gonna be placed in an unordered list on the Sermon list page Ok so now let's go look at this specific layout Layout helper Sermon list item [00:03:15](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m15s) So In layouts Look for sermon List item there we go and in sermon list item You see that I'm using that Global The item that is being passed is placed inside of displayed data I'm so now display data is basically The item object [00:03:43](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m43s) And since I Placed the parameters in it so I can use different Get method With the specific Global Field name Which is set in the components Global settings And since I'm Targeting a specific layout Sorry View [00:04:02](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m02s) I'm using the view key Adding it to the string and checking what is the value for this specific view in the globals of the component And On the basis of this I'm actually able to make this view very dynamic And can use it through multiple layouts Based on that View key Now I know if others want to use the layout in their components extending this one it possibly will not work that well [00:04:31](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m31s) But since we are using it for our own component And really for only implementation I don't think that's too big a deal And At the same Token I am able to check Simply what is the view key is it preacher series or category and on a basis of that I ask different Questions that have different implementation of certain Values like series name preacher name and category And there is another Convention that I think is very worthwhile mentioning here And that is the convention of actually [00:05:11](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m11s) In the template We go back here And we go to custom scripting There is the S View placeholder S view placeholder Will be replaced With the actual views name Now since we using a template here So you see this is a template [00:05:32](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m32s) But this sermon list That one I'm adding that template To multiple site views So I'm not just adding it to one site view I'm adding it to multiple site views But since I want this template again to be Dynamic so wherever I add it I I want it to dynamically Add That site views name here [00:05:57](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m57s) And then is as you can see I'm actually asking The global parameters For that site view sermon list style So That means Is is going to add For example preacher there or it's gonna add series there or is gonna add category there so it will say category sermons list style let me show you that in the code So now I have category open I've got preacher open as well as series [00:06:30](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m30s) And you can see That I'm adding sermon grit sermon list sermon table to them all sermon grid sermon list sermon table Sermon grit sermon list sermon table But if I was to open Sermon list in series You see that that name was changed to Series If I was gonna open Sermon list in preacher [00:06:53](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m53s) You see it was changed Preacher If I open it in category You see that it actually added category And that means that our Little Place holder Was dynamically updated by component Builder on the build And then It behaves as you expect now That you would know where is it getting these values [00:07:20](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m20s) If we If we go to the component in the backend And We open it's config File Scroll down We get you an area called preacher custom config Which is again this is a tab And tab's name is preacher and in this tab We have these value preacher display [00:07:48](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m48s) preacherLine truncated
|
||||
|
||||
????
|
||||
In layouts look for sermon list item. In sermon list item you will see that I'm using that global The item that is being passed is placed inside of displayed data I'm so now display data is basically The item object [00:03:43](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m43s) And since I Placed the parameters in it so I can use different Get method With the specific Global Field name Which is set in the components Global settings And since I'm Targeting a specific layout Sorry View [00:04:02](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m02s) I'm using the view key Adding it to the string and checking what is the value for this specific view in the globals of the component And On the basis of this I'm actually able to make this view very dynamic And can use it through multiple layouts Based on that View key Now I know if others want to use the layout in their components extending this one it possibly will not work that well [00:04:31](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m31s) But since we are using it for our own component And really for only implementation I don't think that's too big a deal And At the same Token I am able to check Simply what is the view key is it preacher series or category and on a basis of that I ask different Questions that have different implementation of certain Values like series name preacher name and category And there is another Convention that I think is very worthwhile mentioning here And that is the convention of actually [00:05:11](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m11s) In the template We go back here And we go to custom scripting There is the S View placeholder S view placeholder Will be replaced With the actual views name Now since we using a template here So you see this is a template [00:05:32](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m32s) But this sermon list That one I'm adding that template To multiple site views So I'm not just adding it to one site view I'm adding it to multiple site views But since I want this template again to be Dynamic so wherever I add it I I want it to dynamically Add That site views name here [00:05:57](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m57s) And then is as you can see I'm actually asking The global parameters For that site view sermon list style So That means Is is going to add For example preacher there or it's gonna add series there or is gonna add category there so it will say category sermons list style let me show you that in the code So now I have category open I've got preacher open as well as series [00:06:30](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m30s) And you can see That I'm adding sermon grit sermon list sermon table to them all sermon grid sermon list sermon table Sermon grit sermon list sermon table But if I was to open Sermon list in series You see that that name was changed to Series If I was gonna open Sermon list in preacher [00:06:53](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m53s) You see it was changed Preacher If I open it in category You see that it actually added category And that means that our Little Place holder Was dynamically updated by component Builder on the build And then It behaves as you expect now That you would know where is it getting these values [00:07:20](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m20s) If we If we go to the component in the backend And We open it's config File Scroll down We get you an area called preacher custom config Which is again this is a tab And tab's name is preacher and in this tab We have these value preacher display [00:07:48](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m48s) preacherbox contrast preacher list style And we scroll down we see preachers sermon count preacher email Preacher website and then preacher sermon display And preacher a sermon list display Now if we take that sermon List display And then search for it across The file say make it [00:08:13](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m13s) Cap sensitive we see that it has 6 matches So that means there is 6 places Actually 3 Because one of Each other 6 are in the comments one is category one is series And one is Preacher [00:08:33](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m33s) So those are the different the three different views Let make use of that series list style Now the Series list style Is then being implemented On the basis of That Dynamic updating of the string here And so it's simply getting thLine truncated
|
||||
Reference in new issue
Block a user