General Technical Discussions for Service

Get Involved. Join the Conversation.

Topic

    Monica Valois
    How to reference a custom widget?Answered
    Topic posted July 14, 2017 by Monica ValoisBronze Medal: 1,250+ Points, last edited July 14, 2017 
    128 Views, 4 Comments
    Title:
    How to reference a custom widget?
    Content:

    I duplicated a widget to customize it, but I have an error when I reference to the path.

    This first image(Standard) shows the path of the standard widget and the second image(Custom) shows the path of the custom widget.
    When I deploy it, it shows me this error: (Error2) "'/chat/chat_launch.php', refers to a widget that does not exist (route widget: customer/development/widgets/custom/ChatLaunchButton_V2)"

     

    Document:

    Best Comment

    Robert Surujbhan

    Monica, 
    Your code reference to the custom widget is wrong.  First, you should create a sub-directory in /cp/customer/development/widgets/custom for your widgets to be (for example, "/mywidgetsfolder").  Your specific widget directory will then go into this directory ("/mywidgetfolder/ChatLaunchButton_V2").  Then, your code reference in the chat_launch page code would become:

    <rn:widget path="custom/mywidgetsfolder/ChatLaunchButton_V2" />
    

    Have you considered using the Customer Portal widget builder available in the CP Administration area? If not, I would recommend it here - it's a good way to start the process of extending an existing widget or building a new one from scratch. It will automatically create the right widget files and directories for you based on an interactive wizard. The wizard can activate your new custom widgets too (otherwise, you will need to activate your widget manually in CP Admin before it can be used on a page).

    Comment

     

    • Monica Valois
    • Monica Valois
    • Monica Valois
    • Robert Surujbhan

      Monica, 
      Your code reference to the custom widget is wrong.  First, you should create a sub-directory in /cp/customer/development/widgets/custom for your widgets to be (for example, "/mywidgetsfolder").  Your specific widget directory will then go into this directory ("/mywidgetfolder/ChatLaunchButton_V2").  Then, your code reference in the chat_launch page code would become:

      <rn:widget path="custom/mywidgetsfolder/ChatLaunchButton_V2" />
      

      Have you considered using the Customer Portal widget builder available in the CP Administration area? If not, I would recommend it here - it's a good way to start the process of extending an existing widget or building a new one from scratch. It will automatically create the right widget files and directories for you based on an interactive wizard. The wizard can activate your new custom widgets too (otherwise, you will need to activate your widget manually in CP Admin before it can be used on a page).