Issue
-
We would like to override the behavior of the default Terms and Conditions that can be activated in Liferay.
-
Where is this logic located in the code?
-
How can we override it?
Environment
- DXP 7.0+
Resolution
- An older article: Terms of Use describes how you can set your own TOS.
-
This part of the code in our GitHub repository is responsible for creating the Terms of Service.
It is a general journal-article based portlet. - Based on the following HTML code:
I found this line of code that seems to control the behavior, and this also lead me to UpdateTermsOfUseAction.java.<form action="/c/portal/update_terms_of_use" class="form " data-fm-namespace="" id="fm" method="post" name="fm"><input class="field form-control" id="formDate" name="formDate" type="hidden" value="1724229542834"> <input class="field form-control" id="p_auth" name="p_auth" type="hidden" value="e5WwsChO"> <input class="field form-control" id="doAsUserId" name="doAsUserId" type="hidden" value=""> <input class="field form-control" id="referer" name="referer" type="hidden" value="/c">
<div class="sheet-text">
<p><span> Placeholder for Terms of Use </span></p>
<p><span> Terms of use are shown to each user on first login. An administrative user must configure the Terms of Use at Control Panel > Configuration > Instance Settings. </span></p>
</div>
<div class="sheet-footer"><button class="btn btn-primary" type="submit">I Agree</button>
<div class="lfr-tooltip-scope"><button class="btn btn-secondary" type="button">I Disagree</button></div>
</div>
</form> - The button's text seems to be coming from terms_of_use.jsp.
- If you want to override the behavior, I believe you need to override these classes and files in your implementation.