Salesforce Certified B2C Commerce Developer free question 7 / 10 · Domain 4: Application Development
A developer declares a custom tag with ismodule and the name attribute set to bgcolor, and wants to use the tag further down in the same template. How is the tag written at the place of use?
- As a bgcolor tag, with the same name as in the declaration
- As an ismodule tag, with the name attribute set to bgcolor once more
- As an isbgcolor tag, with the is prefix added to the declared name
- As an isinclude tag, with the template attribute set to bgcolor
Show the answer and explanation
Answer: C
Why this is correct
The ismodule page says custom tags are always declared without the is prefix, for example mytag. When the custom tag is used in a template, the is prefix must be included, like <ismytag>. A tag declared with the name bgcolor is therefore written as isbgcolor at the place of use.
Why the other options are wrong
"As a bgcolor tag, with the same name as in the declaration" … The page says the declaration leaves out the is prefix, and that the tag must include the is prefix when it is used in a template.
"As an ismodule tag, with the name attribute set to bgcolor once more" … ismodule declares the custom tag before its first usage. Using the tag means writing it like any other tag, with the is prefix.
"As an isinclude tag, with the template attribute set to bgcolor" … A custom tag is similar to an included template but is used like any other tag, with its own name and the is prefix, and it can have user-defined attributes.
Key points
The declaration can be anywhere in the template as long as it appears before the first usage. Multiple declarations of the same tag don’t interrupt processing, and the last one is used.