1

I'm trying to remove the author/submitted information from an entityform submission view and I don't seem to find the right way to do so.

I'm using Display Suite to manage the view of the email that is being sent to the user with the values of the submission, also in the regular view submission page. The submission is for anonymous users, so it's useless to add the following prepended information:

Submitted by Anonymous on thu, 06/12/2014 - 14:18

Which obviously doesn't make any sense in the way my form is working.

Does anyone knows how to achieve the removal of this information?

Thanks!

1

That value is a t() function call here http://cgit.drupalcode.org/entityform/tree/entityform.module#n1092

This is used by the custom EntityClass provided by the EntityForms module in the buildContent function: http://cgit.drupalcode.org/entityform/tree/entityform.module#n1226

This is PHP class. You have many options:

  • See if there is a TPL file defined for this submission and alter the default output with your own.
  • Try to use String Overrides to and set the t() string to "" in the Admin interface for String Overrides. The string you'd look to replace is "Submitted by !name on !date". This may have un-desired affects for other content types and non-Anonymous users ...
  • Your other option is to replace the custom EntityForms class with 1 of your own using a database query to change the system table's entry for the EntityForms class to 1 you copy-paste of the same name and change the 1 line of code in it :/ (I don't really recommend this.
  • Lastly you can use hook_page_alter to scan for the string in the content array of the Node on the page and remove the text out.
  • Or really lastly, you can hide the text using CSS rules.
2
  • Thank you @tenken, I tried modifying the TPL file defined for the email but it's not working, it seems it's completely ignoring the template file as I modify it and nothing happens. I changed another display suite view template file and it works, so it's only the email template which is not being considered. – Dani Sep 23 '14 at 15:17
  • At the end I solved my problem by creating a customized email retrieving the values using rules. If I have to change a label or the way a value is being displayed I have to modify two different areas plus possible language translation code for the future to allow different languages, which is quite annoying. At least now I have what I was looking for. – Dani Sep 23 '14 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.