Skip to content

16. Depricated

JoomlaBoat edited this page Dec 6, 2021 · 1 revision

Old original if statements are deprecated - use Twig instead.

Example

{if:[stock]>0}<h3>Product available.</h3>{endif}

or

{if:"[name]"="Ivan"}<h3>Welcome [name]</h3>{endif}

How to hide rows when search parameters not specified yet.

"I would like to see nothing and only when I search something I would like to see data."

To show or hide part of the layout use the IF statement

This is Catalog Page layout example:

{add}
{print}
{batchtoolbar:edit,publish,unpublish,refresh,delete}
{if:"{currenturl:string,where}"!=""}{catalog}{endif}
*fullname*
{search:fullname}	*email*
{search:email}	*date*	Action
{searchbutton}
{pagination}

{if:"{currenturl:string,where}"!=""}{catalog}{endif} - is the condition.