简体   繁体   中英

how to add a container/widget/simple widget/vtl file dynamically in dotCMS

Scenario: I have an autocomplete country widget. So when:

  1. I start typing a country name in the textbox, the countries that match that query appears. Lets say I type "Co" and it shows me "Colombia" and "Congo" in a list.
  2. Then I select "Congo".

When I select Congo I want to call a Widget/Container/vtl file/whatever that brings me the information I want formatted the way the widget is formatted. Lest say, all the info of the Congo, Location, Population, a brief description, etc.

I tried with the RestAPI and thought of using dotParse()? But I'm new on this I have no idea if this is even possible. I searched in the docs, but didn't find anything similar.

So how can I do this possible?

I have the Widget created, do I only need to call it via the RestApi?

Do I have to create a Container first?

Thanks in advance, for your help.

Thanks i

It sounds like what you want is the RESTful widget API. This is a remote call that will return your widget rendered. See:

http://dotcms.com/docs/latest/WidgetAPI

and

http://dotcms.com/docs/latest/remote-widgets

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM