When i update a portal widget, the change is not reflected in the page on the portal.Why? Am i missing something?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2017 05:27 PM
I have the HTML TEMPLATE of the widget as follows:
<div>
<!--<div class="panel panel-default"> -->
<!-- <div class="panel-heading"> -->
<h4 style="margin-top: 0; margin-bottom: 0">
<span ng-if="::data.glyph" class="fa-stack">
<i class="fa fa-circle text-{{::data.color}} fa-stack-2x"></i>
<i class="fa fa-{{::data.glyph}} fa-stack-1x fa-inverse"></i>
</span>
<p class="title">{{::data.title}}</p>
</h4>
<div>{{::data.short_description}}</div>
<!-- </div> -->
<div class="list-group">
<span class="list-group-item no-border" ng-repeat="item in ::data.items">
<i ng-if="::item.glyph" class="fa fa-{{::item.glyph}} m-r-sm"></i>
<i ng-if="::!item.glyph" class="fa fa-chevron-right m-r-sm"></i>
<span><a href="{{::item.href}}" ng-if="item.label != '35 Stirling Highway Perth <br/>WA 6009 Australia' && item.label != '(+61) 8 6488 6000'">{{::item.label}}</a>
<span class="footer-span" href="{{::item.href}}" ng-if="item.label == '35 Stirling Highway Perth <br/>WA 6009 Australia' || item.label == '(+61) 8 6488 6000'" ng-bind-html="item.label"></span>
</span>
</span>
</div>
</div>
When I try and change '35 Stirling Highway' to something else, it is not reflected on the portal page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2017 05:43 PM
Hey Shaun,
Without some more context it's a bit hard to say what might be happening.
If you cloned the widget from the OOB one, then you might need to update the page's widget instance with the cloned widget.
If it's a normal widget linked within a widget instance, make sure that the correct name is showing when `Ctrl + Right-Clicking` on the widget:
You could also try clicking through to the "Instance in Page Editor" and ensure that the widgets layout is expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2017 05:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2017 06:06 PM
Hey,
So you have this code:
<span>
<a href="{{::item.href}}" ng-if="item.label != '35 Stirling Highway Perth <br/>WA 6009 Australia' && item.label != '(+61) 8 6488 6000'">{{::item.label}}</a>
<span class="footer-span" href="{{::item.href}}" ng-if="item.label == '35 Stirling Highway Perth <br/>WA 6009 Australia' || item.label == '(+61) 8 6488 6000'" ng-bind-html="item.label">
</span>
So for each item you render either the text with a link, or a simple span with HTML content. (based on string matching, should probably see if you can store additional details within `item` such as `link_type` or something)
When you add HTML to an angular field you will need to use `ng-bind-html` to correctly render the HTML.
<span>
<a href="{{::item.href}}" ng-if="item.label != '35 Stirling Highway Perth <br/>WA 6009 Australia' && item.label != '(+61) 8 6488 6000'" ng-bind-html="item.label"></a>
<span class="footer-span" href="{{::item.href}}" ng-if="item.label == '35 Stirling Highway Perth <br/>WA 6009 Australia' || item.label == '(+61) 8 6488 6000'" ng-bind-html="item.label">
</span>
Which part are you attempting to update: the footer or the widget, or both?
What's the expected behavior here? I'm thinking that you're saying the `<br />` should be interpreted as HTML rather than being rendered as text. (in which case the above should resolve this)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2017 06:11 PM