Tips and Tricks for Widgets

From Flux Developer Portal

Jump to: navigation, search

Is it possible to program the ‘content widget’ to display content items from a category?

Yes, there is extended parameter for such cases: dataAccessUrlFix. For example, Most Popular Photos widget code would look something like this:

<script type="text/javascript"> Flux.Utils.WidgetsLoader.createWidget( 'SimplePhotos', {accessKey: '1208fad2-5e86-424f-b383-16b9f2d3e5b0',title: 'Most Popular Photos',viewMode: 'icons',width: '300px',imageSize: Flux.API.ImageSize.Medium,textFont: 'Arial',textFontSize: '10px',headerFontSize: '14px',count: 9,backgroundColor: '#FFFFFF',textColor: '#000000',headerColor: '#CCCCCC',textHeaderColor: '#333333',loginShowArea:true,loginColor: '#F2F2F2',loginTextColor: '#333333',loginLinkColor: '#4866C8',loginFontSize: '11px',borderWidth:'1px',borderColor: '#999999',borderStyle: 'solid' , dataAccessUrlFix: '/Feeds/Pictures/-/[category name]' } ); </script>

This is actually DAAPI URL replacement at runtime which happens just before sending request to flux DAAPI in a widget.

Please note: this will work ONLY on production, not on staging.

Personal tools
Toolbox