What are widgets?

1 Widgets

Widgets are dynamic, visual element. A widget is usually embedded in a view script to generate a complex, yet self-contained user interface.

For example: UserLoginWidget generates a form with fields for login to Gentics Portal.Node PHP.

Widgets can be configured to customize their behavior. This is done by setting their initial property values when calling the widget.

For example, when using a comments widget, we might like to specify if anonymous comments are allowed:


Also properties can be set in PHP arrays:

    $this->widget('friends.widgets.FriendsSearchWidget', array('profileFields' => array('firstname', 'lastname')))?>

2 Deactivating widgets

All widgets in Gentics Portal.Node PHP are placed inside specific modules.

For example “comments”:

  • CommentsAmountWidget
  • CommentsFormWidget
  • CommentsListWidget
  • CommentsWidget

If you need to deactivate the comment widget, you need to deactivate the complete module.

This can be done by specifying the following in configuration:

 'comments'=> array(
    'enabled' => false

All modules (including widgets) which are activated in the main configuration /frontend/config/main.php must be specificly deactivated in your custom-configuration!