I was customizing a few Enterprise Portal pages and there was a requirement to create a section responsible for displaying image or gif with advertisment. As it is a simple image or gif file, I assumed that it would be easier for key users to change them at Microsoft Dynamics AX level, not at Enterprise Portal level.
I added four new fields in ECPParameters table, which are defining href attribute (NavigateUrl), img src attirubte (ImageUrl), width and height. After that I created a regular EP User Control named EPAdvertisment (here is LINK to Microsoft Docs). I am retriving image details from Microsoft Dynamics AX2012 and dynamically building our content.
Step by step.
What we have to do is:
- Create fields in ECPParamters table to define image href attribute, image src attribute and it’s size.
- As always, to see changes in Visual Studio, you will probably have to generate incremental CIL, regenerate proxies etc.
- Create new EP User Control named Advertisment. And let’s prepare our code to display our image.