Creating Widgets

Modified: March 6, 2014 at 2:35 pm EST

Widgets are a simple and effective way of displaying your content in your Sidebar and/or Dashboard.

You can create admin or entity dashboard widgets. Admin dashboard widgets are used for app wide communications. Entity dashboard widgets are for displaying entity content.

Sidebar widgets are of two types; entity and relationship. Sidebar widgets are assigned to the sidebar widget area of your theme. Entity sidebar widgets are used to display entity content whereas relationship sidebar widgets display the connected or related connection types of your entity content. Relationship widgets must be attached to a relationship.

create a new widget
To create a widget
  1. After you created your App, click on Widgets tab.
  2. Click on the Add new widget link.
  3. Select if you want to create Dashboard or Sidebar widget using the type dropdown.
  4. Select Dashboard or Sidebar widget subtype; entity, admin, or sitebar etc using the subtype dropdown.
  5. If you selected entity subtype fill in name and attach your widget to an Entity.
  6. If you selected admin subtype fill in the initial html message. You can always set new messages by clicking on “Configure” link after app generation.
  7. Optionally, create a new layout modifying the default layout by inserting tags.
  8. Fill in the other optional fields such as Entities per Page, List Order etc.
  9. Click Save to finish.

The following describes the basic entity fields.

Type
Sets type of the your widget. You can create a Dashboard or Sidebar widget.
Subtype
Sets subtype of the dashboard or sidebar widget.
Attach to Entity
Entity widgets must be attached to already defined entity. The attached entity’s content are returned by the widget.
Dashboard widget title
Sets Title of the dashboard widget which will be displayed on the backend dashboard page.
Widget message html
Sets the initial html message of the admin dashboard widget.
Title
Title of the widget which will displayed on the frontend.
Label
Title of the widget which will displayed on the backend.
Widget description
A short description explaining what the widget does.
Layout
The layout of the entity’s content using its widget. It defines how the content will be displayed using the widget.
Css
The custom css code to be used when displaying the content. You can leave this field blank and use a common css file for all.
Entities Per Page
Number of entity content to show per page. Use any integer value or -1 to show all.
List Order
Allows the content to be sorted ascending or descending by a parameter selected. Defaults to descending.
Sort Retrieved Posts By
Allows sorting of retrieved content by a parameter selected. Defaults to date.
Show By Status
Retrieves content by status, default value is publish.
Connection Type (WPAS 3.0)
Sets the connection type of a relationship that will be displayed on your widget. Connection type could be either connected or related. Connected type displays the – many – side objects of a relationship. Related type is only used in many-to-many relationships and displays similar related objects. For example, in a products to orders many-to-many relationship; connected shows the orders which include the product selected and related shows the products which are also included in the same order of the selected product i.e. Customer who purchased this also purchased type.
Attach to Relationship (WPAS 3.0)
All relationship widgets must be attached to a predefined relationship. Relationship widgets display the content of the attached relationship. You can set the widget’s layout in the relationship that is attached.
comments powered by Disqus