Collecting module TOS

The collecting module Terms Of Service text is on the Sites Admin>settings>collecting>terms of service. When clicking on the TOS link on a collection page it displays the raw text–no format. I would like to have the collecting TOS link go to a TOS page that I construct. How can I do this. Putting a link on the Admin setting page does not seem to work.

Yes, the Collecting’s TOS does not recognize HTML. I’ve added an issue and will explore it further. In the meantime you could modify the code yourself to make the TOS page render HTML. Just open this file:

/modules/Collecting/src/Controller/Site/IndexController.php

And in IndexController::tosAction(), change this line:

$response->getHeaders()->addHeaderLine('Content-Type', 'text/plain; charset=utf-8');

To this:

$response->getHeaders()->addHeaderLine('Content-Type', 'text/html; charset=utf-8');

You should now be able to add HTML to the TOS field.

Jim, Thanks for your reply. I have changed the .php file as above. The TOS link on the Collecting page still points to the same place. I put a link in the Sites Admin>settings>collecting>terms of service that can be clicked to go to the new TOS page, but that means the user has to click that link. What I think is needed is to be able to change the TOS link on the Collection page to point to something else. Can this be done?
Thnx

Sorry, I misunderstood what you wanted. I’ve updated the issue to reflect this.

What I think is needed is to be able to change the TOS link on the Collection page to point to something else. Can this be done?

We’ll look into this. In the meantime you could change the code yourself. Open this file:

/modules/Collecting/src/Api/Representation/CollectingFormRepresentation.php

And in CollectingFormRepresentation::getForm() , change this line:

sprintf(
    '<a href="' . $tosUrl . '" target="_blank" style="text-decoration: underline;">%s</a>',
    $translator->translate('Terms of Service')
)

To this:

sprintf(
    '<a href="http://www.your-site.com/path/to/tos.html" target="_blank" style="text-decoration: underline;">%s</a>',
    $translator->translate('Terms of Service')
)

Note that you need some text in the “Terms of service” (in site settings) for this to display.

Jim, Thanks! That worked perfectly.