Search.../

readMoreActionData

Sets or gets the data object of the read more action for the collapsible text.

Description

Setting the readMoreActionData property sets the data object of the read more action for the collapsible text. When a site visitor wants to read more, the collapsible text can handle the remaining text in 2 ways, 'ExpandOnCurrentPage' or 'LinkToContent', defined in the readMoreActionType property.

For each readMoreActionType there is a readMoreActionData property. The readMoreActionData property contains a data object which allows you to define the relevant settings for the selected readMoreActionType. Set the following data object values for the readMoreActionType you selected:

ExpandOnCurrentPage

  • readMoreButtonText: Text of the read more button.
  • readLessButtonText: Text of the read less button.
  • collapsed: Whether the collapsible text is currently collapsed.

LinkToContent

  • link: Required. Link for the remaining content. Supports all link types.
  • target: Determines where the link opens.
  • readMoreButtonVisible: Whether the read more button is visible. If true, the button links to the remaining content link. If false, the introductory text links to the remaining content link. Defaults to false.
  • readMoreButtonText: Text of the read more button.

Note: If the readMoreActionType is 'LinkToContent', you must set the link in the LinkToContent object.

Getting the readMoreActionData property gets the data object of the read more action for the collapsible text. Get the data object relevant for the selected readMoreActionType.

Type:

ExpandOnCurrentPage

 | 

LinkToContent
Read & Write

ExpandOnCurrentPage

LinkToContent

NAME
TYPE
DESCRIPTION
readMoreButtonText
string

Text of the read more button. Defaults to Read more.

readLessButtonText
string

Text of the read less button. Defaults to Read less.

collapsed
boolean

Whether the collapsible text is currently collapsed. Defaults to true.

Was this helpful?

Get the readMoreActionData when readMoreActionType is ExpandOnCurrentPage

Copy Code
1const myReadMoreActionData = $w('#myCollapsibleText').readMoreActionData;
2
3/*
4 * {
5 * readMoreButtonText: 'Click here for more',
6 * readLessButtonText: 'Show Less',
7 * collapsed: true
8 * }
9 */
Set the readMoreActionData when readMoreActionType is ExpandOnCurrentPage

Copy Code
1$w('#myCollapsibleText').readMoreActionData = {
2 readMoreButtonText: 'Click here for more',
3 readLessButtonText: 'Show Less',
4 collapsed: false
5};
Get the readMoreActionData when readMoreActionType is LinkToContent

Copy Code
1const myReadMoreActionData = $w('#myCollapsibleText').readMoreActionData;
2
3/*
4 * {
5 * link: 'www.myContentOverflow.com',
6 * target: '_blank',
7 * readMoreButtonVisible: false,
8 * readMoreButtonText: ''
9 * }
10 */
Set the readMoreActionData when readMoreActionType is LinkToContent

Copy Code
1$w('#myCollapsibleText').readMoreActionData = {
2 link: 'www.myContentOverflow.com',
3 target: '_self',
4 readMoreButtonVisible: true,
5 readMoreButtonText: 'Click here for more'
6};