Title: href not rendering correctly
Last modified: November 16, 2021

---

# href not rendering correctly

 *  Resolved [kimineko](https://wordpress.org/support/users/kimineko/)
 * (@kimineko)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/href-not-rendering-correctly/)
 * Hey there,
 * I am testing your plugin as we are considering to use it for outputting our CRM-
   Data to our Website.
 * So far everything works, but trying to display links which are saved as text 
   fields in D365. It seems that if we put Twig’s Curly Brackets as the href, the
   plugin returns the following error: Unexpected error: Unexpected character “&”
   in “template_10243…”
 * Here’s an example that works, as long as there is only plain text / a regular
   link in the href (<td>[{{ record[“ud_name”].value}}](https://wordpress.org/support/topic/href-not-rendering-correctly/test?output_format=md)
   </td>):
 *     ```
       [msdyncrm_twig]
       {% view entity="ud_tutorial" name="Website | CA-Kurse (kommende)" count="10" cache="PT60M" %}
       <table class="crm-table-wrapper striped" style="border:none">
       <thead class="">
       <tr class="crm-table-th">
       <th style="width:5%"></th>
       <th style="width:15%">Kurs</th>
       <th style="width:15%">Durchführung</th>
       <th style="width:12%;">Beginn</th>
       <th></th>
       <th style="width:50%">Ende</th>
       </tr>
       </thead>
       <tbody>
       {% for recordId, record in entityview.rows %}
       <tr>
       <td>{{ record["ineko_booking_status"].value}}</a></td>
       <strong><td><a href="test">{{ record["ud_name"].value}}</a></td></strong>
       <td>{{ record["udc_executionmode"].value}}</td>
       <td>{{ record["ud_startdatetime"].value | date('d.m.Y') }}</td>
       <td> – </td>
       <td>{{ record["ud_enddatetime"].value | date('d.m.Y') }}</td>
       </tr>
       {% endfor %}
       </tbody>
       </table>
       {% endview %}
       [/msdyncrm_twig]
       ```
   
 * This on the other hand does not work:
 *     ```
       [msdyncrm_twig]
       {% view entity="ud_tutorial" name="Website | CA-Kurse (kommende)" count="10" cache="PT60M" %}
       <table class="crm-table-wrapper striped" style="border:none">
       <thead class="">
       <tr class="crm-table-th">
       <th style="width:5%"></th>
       <th style="width:15%">Kurs</th>
       <th style="width:15%">Durchführung</th>
       <th style="width:12%;">Beginn</th>
       <th></th>
       <th style="width:50%">Ende</th>
       </tr>
       </thead>
       <tbody>
       {% for recordId, record in entityview.rows %}
       <tr>
       <td>{{ record["ineko_booking_status"].value}}</a></td>
       <td><a href="{{record["ud_name_url"].value}}">{{ record["ud_name"].value}}</a></td>
       <td>{{ record["udc_executionmode"].value}}</td>
       <td>{{ record["ud_startdatetime"].value | date('d.m.Y') }}</td>
       <td> – </td>
       <td>{{ record["ud_enddatetime"].value | date('d.m.Y') }}</td>
       </tr>
       {% endfor %}
       </tbody>
       </table>
       {% endview %}
       [/msdyncrm_twig]
       ```
   
 * The String that we are trying to put as the href does not contain an ampersand,
   as mentioned in the error message. Am I missing something or maybe just using
   the wrong syntax?
 * Looking forward to your replies.
 * Best
    Kim
    -  This topic was modified 4 years, 6 months ago by [kimineko](https://wordpress.org/support/users/kimineko/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [alexacrm](https://wordpress.org/support/users/alexacrm/)
 * (@alexacrm)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/href-not-rendering-correctly/#post-15075289)
 * Hi Kim,
 * WordPress encodes the attribute value hence the “corrupted” URL. Try this:
 *     ```
       {% set url = record["ud_name_url"].value %}
       <td><a href="{{ url }}">{{ record["ud_name"].value}}</a></td>
       ```
   
 * Also, I don’t believe you have to use `record["ud_name_url"].value` syntax and
   can use just `record.ud_name_url` in which case you can try simply:
 * `<td><a href="{{ record.ud_name_url }}">{{ record.ud_name }}</a></td>`
 *  Thread Starter [kimineko](https://wordpress.org/support/users/kimineko/)
 * (@kimineko)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/href-not-rendering-correctly/#post-15076181)
 * Hey,
 * thank you very much for the quick and helpful reply! Both ways that you laid 
   out work.
 * The first one as it is, for the second one to work – in our case – we needed 
   to append .value as it would otherwise display “Array”. So for anyone who stumbles
   upon this question in the future:
 * `<td><a href="{{ record.ineko_participant_link_sp.value }}">{{ record.ud_name.
   value }}</a></td>`
 * Best regards
    Kim
    -  This reply was modified 4 years, 6 months ago by [kimineko](https://wordpress.org/support/users/kimineko/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘href not rendering correctly’ is closed to new replies.

 * ![](https://ps.w.org/integration-dynamics/assets/icon-256x256.png?rev=1589904)
 * [Dynamics 365 Integration](https://wordpress.org/plugins/integration-dynamics/)
 * [Support Threads](https://wordpress.org/support/plugin/integration-dynamics/)
 * [Active Topics](https://wordpress.org/support/plugin/integration-dynamics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/integration-dynamics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/integration-dynamics/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [kimineko](https://wordpress.org/support/users/kimineko/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/href-not-rendering-correctly/#post-15076181)
 * Status: resolved