Updated 017 Layout Setup (markdown)
parent
04fe672039
commit
589151cf3d
@ -24,26 +24,25 @@ Since I'm targeting a specific view, I use the view key, adding it to the string
|
||||
|
||||
In the template, go back here and go to custom scripting. (See video.) [00:05:11](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m11s) There is the ''[[[sview]]]' placeholder. The ''[[[sview]]]' placeholder will be replaced with the actual view's name. This is a template since we use a template here. [00:05:32](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m32s) I'm adding the template (this sermon list) to multiple site views, not to one site view. A template can be build and reused in multiple site views simply with this place holder,''[[[sview]]]' which is called site view.
|
||||
|
||||
|
||||
### Dynamic Custom Views using Template
|
||||
|
||||
Since this template again need to be dynamic, so wherever it is added, it should dynamically add that site view's name. [00:05:57](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m57s) Then get from the global parameters that site view 'sermon_list_style'. It is going to add: 'preacher', or it's going to add 'series', or it is going to add 'category' . Then it displays: 'category', 'sermons', 'list', 'style'.
|
||||
Since this template has to be dynamic it should dynamically add the site view's name wherever it is added. [00:05:57](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m57s) From the global parameters get the site view 'sermon_list_style'. It will add 'preacher','series', or 'category'. It displays 'category', 'sermons', 'list', 'style'.
|
||||
|
||||
### Above In The Code
|
||||
|
||||
Looking to that in the code. With 'category', 'preacher' and 'series' open. [00:06:30](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m30s) Then 'sermon-grid', 'sermon-list', 'sermon-table' is added to them all. If 'sermon-list' in 'series' is opened, it will be seen that 'name' has been changed to 'series'. If 'sermon-list' in 'preacher' is opened, it has been changed to 'preacher'. [00:06:53](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m53s) If it is opened in 'category', it can be seen that 'category' has been added to it. Consequently the place holder has been dynamically updated by Component Builder.
|
||||
Look at it in the code, 'category', 'preacher' and 'series' open. [00:06:30](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m30s) 'Sermon-grid', 'sermon-list', and 'sermon-table' are added to them all. If 'sermon-list' in 'series' is opened, the 'name' had been changed to 'series'. If 'sermon-list' in 'preacher' is opened, it had been changed to 'preacher'. [00:06:53](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m53s) If it is opened in 'category', 'category' has been added to it. Consequently the place holder had been dynamically updated by Component Builder.
|
||||
|
||||
### Config.xml
|
||||
|
||||
Where is it getting these values? [00:07:20](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m20s) Go to the component in the back end, and open it's 'config file' and scroll down. An area called 'preacher_custom_config' can be seen, which is a tab, and the tab's name is 'preacher'. [00:07:48](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m48s) In this tab there are: 'value_preacher_display', 'preacher_box_contrast', 'preacher_list_style'. Scroll down, and see 'preachers_sermon_count', 'preacher_email', 'preacher_website', and then 'preacher_sermon_display', and 'preacher_sermon_list_display'. Now if we take that 'sermon_list_display', and search for it across the file. [00:08:13](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m13s) Make it cap sensitive. There are 3 matches: 'Category' 'Series' and 'Preacher' which are the 3 different views that make use of that 'series list style'. [00:08:33](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m33s) The 'series list style' is then being implemented on the basis of that dynamic updating of the string. It gets the style, then does a switch statement and sets it accordingly. This is a nice to have tool to make a template more dynamic. [00:08:57](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m57s) As already mentioned a template can be build and reused in multiple site views simply with this place holder,''[[[sview]]]' which is called site view.
|
||||
Where is it getting these values? [00:07:20](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m20s) In the component in the back end open 'config file' and scroll down. An area called 'preacher_custom_config' can be seen, which is a tab, 'preacher'. [00:07:48](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m48s) In this tab there are 'value_preacher_display', 'preacher_box_contrast', 'preacher_list_style'. Scroll down, and see 'preachers_sermon_count', 'preacher_email', 'preacher_website', 'preacher_sermon_display', and 'preacher_sermon_list_display'. Take the 'sermon_list_display' and search for it across the file. [00:08:13](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m13s) Make it cap sensitive. There are 3 matches: 'Category' 'Series' and 'Preacher', the three different views making use of the 'series list style'. [00:08:33](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m33s) The 'series list style' is then implemented on the basis of the dynamic updating of the string. It gets the style, does a switch statement, and sets it accordingly. This is a nice tool to make a template more dynamic. [00:08:57](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m57s) As already mentioned a template can be built and reused in multiple site views with this place holder,''[[[sview]]]' called site view.
|
||||
|
||||
### Layout Concept
|
||||
|
||||
The layout concept is more or less the same as with templates.[00:09:27](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m27s) It has a layout area in which you put your script and here (see video) the key replacing is used. If certain dynamic gets are selected , the liberty is taken of showing that we are starting with display data. But this snippets here(see video), might not correspond to what you're doing because you can really pass anything to a layout. We are just assuming that if you're using that dynamic get, you possibly passing it in this way or that way. [00:10:06](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m06s) You can't copy and paste this necessarily. At least you can know when you look at a specific dynamic get, that that are the values in it and how you can try figure out which ones to use. This again will be only really something you can use if you are actually aware of that PHP will do the implementations. [00:10:34](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m34s) If you are not familiar with it, it is not necessary to use layouts. The whole front end may be build in the site view. It will work although it might be a lengthy script. Layouts and templates has been added simply for convenience.
|
||||
The layout concept is more or less the same as with templates.[00:09:27](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m27s) It has a layout area in which you place your script; here the key replacing is used. (See video.) If certain dynamic gets are selected , the liberty is taken to show that we start with display data. But these snippets might not correspond to what you're doing because you can pass anything to a layout. (See video.) We assume that if you're using the dynamic get, you might pass it in this or that way. [00:10:06](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m06s) You can't necessarily copy and paste this. At least when you look at a specific dynamic get you'd know the values in it and can try figuring out which ones to use. You can only use this if you are aware that PHP will do the implementations. [00:10:34](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m34s) If you are not familiar with it, it is not necessary to use layouts. The entire front end may be build in the site view. It will work, although it might be a lengthy script. Layouts and templates had been added for convenience.
|
||||
|
||||
### Layout Custom Script Area
|
||||
|
||||
In layouts is the same concept of adding custom scripting which will be placed in the head of the file. Remember that the global data or the data being passed is in 'display data' [00:11:14](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m14s) This is a HTML area but you can go into PHP and check some values and on the basis of that, do the necessary implementations. That is setting up a layout.
|
||||
In layouts the same concept of adding custom scripting which will be placed in the head of the file is found. Remember that the global data or the data being passed is in 'display data.' [00:11:14](https://www.youtube.com/watch?v=52OLSZio0F8&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m14s) This is a HTML area but you can go into PHP and check some values, on the basis of which you can do the necessary implementations.
|
||||
|
||||
### A Note: Use Layout in a Layout
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user