C# Macros syntax on Widget Portal Engine

Chandra Bhattarai asked on March 3, 2021 05:06

I am trying to build a widget in portal engine but not being able to locate the place to write C# Macros. I am making text image carousel widget where i need to call the tree node items of images and write HTML to display it, so where can i write the code to pull the data and other stuffs

Recent Answers

Elmar Höfinghoff answered on March 3, 2021 12:33 (last edited on March 3, 2021 12:33)

I would do something like this:

  • the carousel widget get's one field "DataSource". Use a page selector.
  • add a data page type for a carousel slide. Add image and text here.
  • use the code generator to generate info and provider classes of the carousel slide page type.
  • The widget rendering can now access the parent page of your slides over the data source field (guid)
  • Use the slide provider class to get all slides unter the data source guid page.
  • use a foreach loop to iterate over the slides. You can use the info class to access the properties directly. No need for a macro.
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.