Updated 016 Template Setup (markdown)
parent
663e7ef241
commit
6f6e009498
@ -6,4 +6,16 @@ In the previous tutorial we where looking at setting up of templates and layout
|
||||
|
||||
**New - Copying Templates**
|
||||
|
||||
You can click on new to start with a new template You could also copy an old one By selecting The template you would like to copy click on batch And then there is a copy feature here And click process And it'll copy it for you Ok so [00:00:49](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m49s) here I have Preacher panel open In Preacher panel it's the same concept it's an HTML area so if I wanna use PHP I need to go Into the PHP And then I can go out again And I can also add this text placeholders Which helps us to ensure The text itself Is translatable You can just do your normal English text like that sermon count [00:01:16](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m16s) Sermon total downloads And Component Builder will add these strings to the language file for you And You don't need to be concerned though at this stage only does Your British English language file And If you need to add more languages You need to look up the documentation of adding languages to a third-party extension [00:01:44](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m44s) And do that same implementation Ok so here we see that you can add layouts To this template by using any of the Snippets to this template And you can add other templates to it So you can use templates inside of templates And you could have use layouts as well so more or less the same behaviour as in site view You also have your snippet box here [00:02:15](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m15s) Which you can make use of adding Script quickly To your page Like that Refresh We see that that script that I just looked at here In the preacher panel If we go to the code preacher panel it Is exactly the same script that you seeing here Ok now [00:02:46](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m46s) There are a few exciting points here One of them is a side note is that in your details tab In the template area You're at the bottom You can add JavaScript With your normal script tags So you can just add your JavaScript in there And [00:03:13](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m13s) It will work And be loaded into the page Through the small snippet That's That's a nice Thing to know As well as You are still have access as I said before to all the global This field values Like you can see there [00:03:35](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m35s) You can access those quite easily And that is basically how to set up a template Is the same kind of conventions as setting up a site View Except that this is not the main view it is a template used Somewhere in a main view through Adding this code snippet With Joomla class get template Method [00:04:02](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m02s) And Then Basically this Load template Is the method That is being used with that name And then it adds it Do your component site view as well as Adds the code to it and everything else So that is a template next up let's look at a layout [00:04:29](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m29s) And it really get excited there
|
||||
You can click on new to start with a new template. You could also copy an old one by selecting the template you would like to copy. Click on batch and then there is a copy feature here and click process and it'll copy it for you. [00:00:49](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m49s) Here I have preacher panel open. In preacher panel it's the same concept it's an HTML area. If I want to use php I need to go into the php. Then I can go out again. I can also add this text placeholders, which helps us to ensure the text itself is translatable. You can just do your normal English text like that 'sermon count', and [00:01:16](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m16s) 'total downloads'.
|
||||
|
||||
**Language String**
|
||||
|
||||
Component Builder will add these strings to the language file for you. You don't need to be concerned. At this stage it only does your British English language file. If you need to add more languages, you need to look up the documentation of adding languages to a third-party extension, [00:01:44](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m44s) and do that same implementation. Here(Layouts Code Snippets) we see that you can add layouts to this template by using any of the snippets to this template. You can add other templates to it. You can use templates inside of templates. You could have use layouts as well so more or less the same behavior as in site view.
|
||||
|
||||
**Adding Custom Script/Code to Template**
|
||||
|
||||
You also have your snippet box, [00:02:15](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m15s) which you can make use of adding script quickly to your page. We see that the script that I just looked at in the preacher panel, if we go to the code, preacher panel, it is exactly the same script that you seeing here(code). [00:02:46](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m46s)
|
||||
|
||||
**Adding JavaScript To Template**
|
||||
|
||||
There are a few exciting points here. One of them is a side note in your details tab, in the template area here at the bottom. You can add JavaScript with your normal script tags. You can just add your JavaScript in there. [00:03:13](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m13s) It will work and be loaded into the page through this little snippet. That's a nice thing to know. You still have access as I said before to all the global 'this' field values, like you can see there. [00:03:35](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m35s) You can access those quite easily. That is how to set up a template, is the same kind of conventions as setting up a site view. Except that this is not the main view, it is a template used somewhere in a main view through adding this code snippet with Joomla class get template method. [00:04:02](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m02s) Then basically load template as the method that is being used with that name. Then it adds it to your component site view as well as adds the code to it and everything else. That is a template. next up we will look at a layout. [00:04:29](https://www.youtube.com/watch?v=khxKeeubhiY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m29s) It really get excited there.
|
||||
|
Loading…
Reference in New Issue
Block a user