When i update a portal widget, the change is not reflected in the page on the portal.Why? Am i missing something?

shaunlingham
Kilo Explorer

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.

8 REPLIES 8

Domenic Horner
Tera Expert

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:


find_real_file.png



You could also try clicking through to the "Instance in Page Editor" and ensure that the widgets layout is expected.


shaunlingham
Kilo Explorer

I thought I might give a little more context. My footer on the portal looks like


find_real_file.png



and my widget looks like so:


find_real_file.png



I want to change the address listed under 'Contact UWA'


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)


Can you tell me where the data objects for the following on the widget are coming from



$sp.getMenuItems


find_real_file.png



I'm a bit new to scripting widgets....