Show all icons in the widget

Sathwik1
Tera Expert

Show all icons in the widget, as of now only it was restricted to the 3 and reamining are getting after clicking on the button only.

1 ACCEPTED SOLUTION

Robert H
Mega Sage

Hello @Sathwik1 ,

 

This is not configurable, so you have only two options:

 

A) Clone the "Sub-topics" widget and modify it as needed.

 

or

 

B) Create a wrapper widget that enables the "view all" mode by default. I prefer this because inside that wrapper we'll still use the OOTB widget, so it remains up to date when you do an upgrade.

 

Application Scope: Employee Center

Name: Custom Sub-topics wrapper

ID: custom_sub_topics_wrapper

HTML template:

<div>
  <widget id="content_taxonomy_topic_subtopics"></widget>
</div>

 Link function:

function link(scope, element, attrs, controller) {
	scope.data.content_taxonomy_topic_subtopics.data.viewAllMode = true;
}

 

Then you'll just have to edit the "Employee topic" page and replace the OOTB widget with the wrapper.

 

Result:

RobertH_0-1744228178793.png

 

Regards,

Robert

View solution in original post

4 REPLIES 4

swapnali ombale
Kilo Sage

Hi @Sathwik1 

 

Please tyr this

  • Clone the "Sub-Topics" widget.
  • Modify/Comment the View All button code from line 14 to 16 as needed.
  • swapnaliombale_0-1744227392372.png

     

  • After making the changes, add the cloned widget to the required pages.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Robert H
Mega Sage

Hello @Sathwik1 ,

 

This is not configurable, so you have only two options:

 

A) Clone the "Sub-topics" widget and modify it as needed.

 

or

 

B) Create a wrapper widget that enables the "view all" mode by default. I prefer this because inside that wrapper we'll still use the OOTB widget, so it remains up to date when you do an upgrade.

 

Application Scope: Employee Center

Name: Custom Sub-topics wrapper

ID: custom_sub_topics_wrapper

HTML template:

<div>
  <widget id="content_taxonomy_topic_subtopics"></widget>
</div>

 Link function:

function link(scope, element, attrs, controller) {
	scope.data.content_taxonomy_topic_subtopics.data.viewAllMode = true;
}

 

Then you'll just have to edit the "Employee topic" page and replace the OOTB widget with the wrapper.

 

Result:

RobertH_0-1744228178793.png

 

Regards,

Robert

Thank you so much, can you explain a bit more on the below line of code please? we are setting "data.ViewAllMode" value in which script? client controller? or server script? or where exactly?

->scope.data.content_taxonomy_topic_subtopics.data.viewAllMode = true;

and data.content_taxonomy_topic_subtopics means widget name right?

 

Hello @Sathwik1 ,

 

Thank you for marking the answer as correct.

 

Regarding your questions: 

The script goes into the "Link function" part of the widget. It might not be visible by default but you can show it by clicking the check box shown below.

RobertH_0-1744263058472.png

Server or client script are not required here.

 

The Link function allows us to access the scope of the embedded OOTB widget and manipulate it, and yes, your assumption is correct that we do this by using "scope.data.content_taxonomy_topic_subtopics" etc.

 

Regards,

Robert