Hello People,
I hope you all are doing just well in this pandemic time and staying home and working from home, Today i will just have a very quick post to demonstrate some of the flexibility of SXA
Requirement
Well, we had very simple requirement where we used OOTB navigation component, and everything worked just fine but we wanted to have all those link open in a new tab, So we started looking at what HTML this navigation component is returning, So we can just create a clone and have our custom links generated, but it did not help as existing component just renders the variant so structure must have been defined in variant
Solution
So next check was for variant structure and i observe that there are no link ("anchor" tag defined), but the beauty of SXA is there is a field call "Is Link" which converts your text field into anchor while rendering, see below
1) Here if you see "Is link" is the one responsible for converting any field of a variant to an anchor (quite cool and handy)
2) And second solution to the problem is because its creating a link internally we needed a way to add target="_blank" to all anchors generated in navigation and if you see "Link attributes" fields, over there you can specify those custom attributes to get those rendered when links are generated
Now all menu links of OOTB navigation component will open in a new window
I think very helpful and quick solution, Powerful SXA !!!
See you in the next post.
The Casino, Hotel and Theme Park - Mapyro
ReplyDeleteThe Casino is 성남 출장마사지 a luxury resort and casino in Paradise, Nevada with 영주 출장샵 30000 slot machines and 40 영천 출장안마 table games. A 서귀포 출장안마 popular feature of The 부산광역 출장안마 Casino, the casino