<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Modifying SOY templates</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119208220" />
  <subtitle>Modifying SOY templates</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119208220</id>
  <updated>2026-04-05T04:19:38Z</updated>
  <dc:date>2026-04-05T04:19:38Z</dc:date>
  <entry>
    <title>RE: Modifying SOY templates</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119240382" />
    <author>
      <name>Burress Shawna</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119240382</id>
    <updated>2020-05-26T12:32:06Z</updated>
    <published>2020-05-26T12:32:06Z</published>
    <summary type="html">One of the solutions posted above worked for me. You can try it too. It would help  &lt;a href="https://www.mybpcreditcard.us/"&gt;https://www.mybpcreditcard.us/&lt;/a&gt;</summary>
    <dc:creator>Burress Shawna</dc:creator>
    <dc:date>2020-05-26T12:32:06Z</dc:date>
  </entry>
  <entry>
    <title>RE: Modifying SOY templates</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119238949" />
    <author>
      <name>Michał Janusz</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119238949</id>
    <updated>2020-05-26T10:18:25Z</updated>
    <published>2020-05-26T10:18:25Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hello David,&lt;br&gt;Thanks for your answer. I have a follow-up question about connecting labels and form fields using for/id HTML attributes.&lt;br&gt;In SOY template&amp;nbsp;&lt;a href="https://github.com/liferay/liferay-portal/blob/7.2.1-ga2/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/src/main/resources/META-INF/resources/FieldBase/FieldBase.soy"&gt;https://github.com/liferay/liferay-portal/blob/7.2.1-ga2/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/src/main/resources/META-INF/resources/FieldBase/FieldBase.soy&lt;/a&gt;&lt;br&gt;There is attributes assigment for label:&lt;br&gt;&lt;a href="https://github.com/liferay/liferay-portal/blob/7.2.1-ga2/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/src/main/resources/META-INF/resources/FieldBase/FieldBase.soy"&gt;&lt;/a&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;label {$attributeslabel}&amp;gt;&amp;lt;/label&amp;gt;&lt;/code&gt;&lt;/pre&gt;But there is no "for" attribute and neither there is "id" of the field that this label is generated for. Can you&amp;nbsp;give me some tips where in Liferay code this list of attributes is generated and injected into the template? And how can I add missing attributes?&lt;br&gt;Regards,&lt;br&gt;Michal&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Michał Janusz</dc:creator>
    <dc:date>2020-05-26T10:18:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: Modifying SOY templates</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119215045" />
    <author>
      <name>Marcin Pawluk</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119215045</id>
    <updated>2020-05-22T07:41:54Z</updated>
    <published>2020-05-22T07:41:54Z</published>
    <summary type="html">Yes, I have reported issue -&amp;gt; &lt;a href="https://issues.liferay.com/browse/LPS-114123"&gt;https://issues.liferay.com/browse/LPS-114123&lt;/a&gt;. I will try your solutions (I hope it will help).</summary>
    <dc:creator>Marcin Pawluk</dc:creator>
    <dc:date>2020-05-22T07:41:54Z</dc:date>
  </entry>
  <entry>
    <title>RE: Modifying SOY templates</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119211884" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119211884</id>
    <updated>2020-05-21T13:03:40Z</updated>
    <published>2020-05-21T13:03:40Z</published>
    <summary type="html">So first, have you reported the issue on issues.liferay.com? To get a product fix, the report has to start there.&lt;br /&gt;&lt;br /&gt;There is no supported way to change soy templates. JSP fragment bundles don&amp;#39;t work because, well, soy templates are not JSP files.&lt;br /&gt;&lt;br /&gt;The only solution is to build an override module. There are two options that I know of here, one that Olaf wrote about &lt;a href="https://liferay.dev/blogs/-/blogs/maintainable-plugins-challenge"&gt;https://liferay.dev/blogs/-/blogs/maintainable-plugins-challenge&lt;/a&gt; and one that I wrote about &lt;a href="https://liferay.dev/blogs/-/blogs/extending-liferay-osgi-modules"&gt;https://liferay.dev/blogs/-/blogs/extending-liferay-osgi-modules&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In each of these cases, you weave override files that you have with the Liferay original module, coming up with a modified module that goes into the osgi/marketplace/override folder.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2020-05-21T13:03:40Z</dc:date>
  </entry>
  <entry>
    <title>Modifying SOY templates</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119208219" />
    <author>
      <name>Marcin Pawluk</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119208219</id>
    <updated>2020-05-21T10:34:10Z</updated>
    <published>2020-05-21T10:34:10Z</published>
    <summary type="html">I&amp;#39;m coming with another topic. We need to override SOY templates to fix some issues in Forms module. What we want to achieve is to connect labels with inputs (what is required by WCAG). I was searching forum and Liferay&amp;#39;s documentation, but only found how to create SOY portlet -&amp;gt; &lt;a href="https://help.liferay.com/hc/en-us/articles/360018159531-Creating-a-Soy-Portlet-"&gt;https://help.liferay.com/hc/en-us/articles/360018159531-Creating-a-Soy-Portlet-&lt;/a&gt;. Is there any example how to override files with soy extentesion?As an example I will use &lt;a href="https://github.com/liferay/liferay-portal/blob/7.2.1-ga2/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/src/main/resources/META-INF/resources/FieldBase/FieldBase.soy"&gt;https://github.com/liferay/liferay-portal/blob/7.2.1-ga2/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/src/main/resources/META-INF/resources/FieldBase/FieldBase.soy&lt;/a&gt;. We need to associate labels with their elements. Now generated field in form looks as below&lt;br /&gt;&amp;lt;div class=&amp;#34;form-group&amp;#34; data-field-name=&amp;#34;_com_liferay_dynamic_data_mapping_form_web_portlet_DDMFormPortlet_INSTANCE_iuOQgE90XKZb_ddm$$TextField$rxnY4qW2$0$$en_US&amp;#34;&amp;gt;&amp;lt;label&amp;gt;Text Field &amp;lt;/label&amp;gt;&amp;lt;input class=&amp;#34;ddm-field-text form-control&amp;#34; name=&amp;#34;_com_liferay_dynamic_data_mapping_form_web_portlet_DDMFormPortlet_INSTANCE_iuOQgE90XKZb_ddm$$TextField$rxnY4qW2$0$$en_US&amp;#34; type=&amp;#34;text&amp;#34; data-oninput=&amp;#34;null&amp;#34; data-onfocus=&amp;#34;null&amp;#34; data-onblur=&amp;#34;null&amp;#34; value=&amp;#34;&amp;#34;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;WCAG validator requires to assign label with input. In Liferay 7.2.1 and 7.3.0 it&amp;#39;s not correct.</summary>
    <dc:creator>Marcin Pawluk</dc:creator>
    <dc:date>2020-05-21T10:34:10Z</dc:date>
  </entry>
</feed>
