Call to action widget
Use this widget to display a one or two call to action buttons on your page. You can have a button from the primary action and a button for a secondary action. Each button can lead to a different page or can display different items from your website or from other sites.
By default, the left button is the primary and the right is the secondary, but you can switch their places or display only one button. You can also style the buttons differently.
Place the widget on the page
You can place a Call to action widget only inside a Section widget.
To do this, perform the following:
- Inside a column from the Section widget, click Add widget here…
- Select the Content tab.
- Click the Call to action widget.
The widget is placed inside the selected column of the Section widget.
- Click Create call to action.
Configure the properties of the buttons
You can configure the buttons properties in the following way:
- Expand Primary action.
- In Action label, enter the label of the primary button.
If you leave the field empty, the primary button will not be displayed and you can display only the secondary button.
- In Action link, enter the link to the page that you want to open when the button is clicked or perform the following:
- To select a page or an item from your website, click Select page or content.
- Under Site, select the website from your multisite instance where the page or the item is located and, if you have multiple languages, select the language by clicking (Edit).
- Under Content type, select the content type that you want to open when the button is clicked.
A list of content items or pages appears.
- Click the desired item or page and click Use selected.
- Expand Secondary action.
- In Action label, enter the label of the secondary button.
If you leave the field empty, the secondary button will not be displayed and you can display only the primary button.
- In Action link, enter the link to the page that you want to open when the secondary button is clicked or select an item from the website as described in Step 3.
Configure the display settings
To configure how to display the buttons in the widget, perform the following:
- Expand Display settings.
- In Style, choose how to style the primary and the secondary buttons.
You can choose from the dropdown boxes with predefined styles.
NOTE: By default, the primary button is displayed on the left, while the secondary on the right. You can switch them by changing their labels, actions, and by choosing Secondary style for the primary button and vice versa.
- In Position, choose how to align the text on the button.
- In Margins, you can choose the margins between the buttons and the column where they are placed.
Choose from the predefined values of none, small, medium, or large.
- Click Save.
Advanced widget settings
To open the advanced settings, in the upper-right corner of the Call to action widget page, click (Advanced settings)
- In Label, you can enter a specific name for this widget.
This name will be displayed in:
- The page editor as a label for the widget
- In the treeview with the page structure in the right pane of the page editor.
- In CSS class, you can enter individual CSS class for the Call to action widget.
- In Attributes, you can enter specific HTML attributes which Sitefinity CMS applies to the HTML tags used when rendering the Call to action widget.
For example, to open the Primary link in a new browser tab, under Attributes » Primary enter target for Key and _blank for Value.
Save your changes.
Add custom button configurations
To add custom button configurations for the widget, insert an additional entry in the
app.settings file as per the following example:
This code adds a new Custom action option to the dropdown boxes with predefined styles and renders the button with the
btn btn-custom classes on the front end.
You can now access the new option through the display settings:
If you want to override one of the out-of-the-box classes –
- Expand Display settings.
- In Style, choose Custom action from the dropdown box.
Secondary, you can do so by inserting an entry with the
"Secondary" in the
ButtonClasses config section and provide your own values for the