Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1.  Consider the condition that needs to be true when you generate this page (Hint: look at the start page rule body and how the first parameter of the page/3 predicate is used in that rule).

  2. Think about what you want to be on this page. It needs somewhere to show text to introduce your agent. For this, you can use a card or an alert, for example. This will be the first atom in your HTML code that we use in Step 3. The second atom should be HTML code with text(formatted) to introduce your bot i.e. what you want to go on your alert or card. This atom needs to be able to add a variable later(the bot’s name) read the Visual Support: A Guide for hints on how to do that.

  3. Use a predicate to combine the first atom and second atom you created in the previous step (check out the Visuals Guide for how to do this). What we created in HTML above is our template, thus the predicate should return the variable Template.

  4. Now we need to get the bot's name in order to add it to our text. This knowledge should be somewhere in the agent's memory. Hint: Look at line 40 in dialog_init for the applicable predicate. Save the name of the bot as a variable.

  5. Next, you should use the applyTemplate/3 predicate to add the bot’s name to our HTML code atom(also detailed in the Visual Support Guide).

  6. Lastly, you should take the variable returned from applyTemplate and use the html/2 predicate to convert your code snippet into a completed HTML page. This can be done by using html(YourCompleteHTMLCodeVariableHere, Html). Html is the variable returned by the page function as you can see in the head of the rule.

...