1

Some random questions from a EE newb...

1.)

a.) Since Layout templates are so handy (cutting the template into interchangeable header/sidebar/footer, etc), why should our use an embed tag? Any ideas on when you should not use an embed tag over a layout tag?

b.) How would I create different template layouts for the user to pick? Would I need a channel for each? (Have't tinkered with multiple layouts yet, just wondering)

2.) A namespace is the words between the parentheses in any given attribute right? For example this:

{exp:channel:entries  channel="News" limit="3 status="open"}
<!--code here-->
{/exp:channel:entries}

"News" would be the namespace right?

2
  • 1
    Please, open multiple questions, so the answers can help others.
    – Sobral
    Aug 19 '16 at 18:47
  • I will comply, my apologies.
    – Greg
    Aug 26 '16 at 13:55
0

1.)

a.) Since Layout templates are so handy (cutting the template into interchangeable header/sidebar/footer, etc), why should our use an embed tag? Any ideas on when you should not use an embed tag over a layout tag?

Layout method is the best in flexibility, easy to use and run fast to. But the problem is you must need to write its code in first line. If you are planning to use CE CACHE plugin or something like that, it needs to write the code on first line and thus, you are not able to use CE CACHE with layouts.

b.) How would I create different template layouts for the user to pick? Would I need a channel for each? (Have't tinkered with multiple layouts yet, just wondering)

There are many ways to do so, It all depends how you want to do it. Simple way should be:
1) create a template group like "_layouts.group".
2) Create different layout html files:
3) Use the files to code by manually or create a channel for that and put options to select. (layouts code must be use in template in first line or else it will throw EE error.)

2.) A namespace is the words between the parentheses in any given attribute right? For example this:

Yes. The name between the parentheses of channel="[short_name]" and all other attributes are values.
Suggestion: Always use disabled parameter with channel loop. It will boost the load of channel loop as it ignores the code given in disabled parameter.
Example: disable="custom_fields|categories|category_fields|member_data|pagination|trackbacks|relationships"

2
  • Could you explain your option in more detail? I get making the but how would you make a channel to plug all that in?
    – Greg
    Aug 26 '16 at 17:44
  • In disable parameter, fields should be use as per needs. If you are not using any custom fields form channel fields you can use "custom_fields". If you are not using categories in loop you can pass "categories" parameter and so on. Aug 26 '16 at 17:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.