We have now seen quite a few recipes on how to create web items and place them at different places in the UI. But in each case, we knew what links were needed. How about creating these links on the fly?
In this recipe, we will see how to create web items dynamically.
Create a new web item, Favourites, in the system top navigation bar, as discussed in the previous recipe.
Let us assume we want to create some links in the system top navigation bar. We have seen the same thing in the previous recipe, but that works only when we know the links in advance. Let us consider a new scenario where the user sees different sets of links when he/she is logged in and not logged in! We can use conditions to check user status, but let us use dynamic link creation for the sake of this recipe.
The following is a step-by-step process to do the same:
Create the Favourites web section in the system top navigation bar.
<web-item key="favourites-menu...