Jump to content

Is it possible to change the "New" text in Page fieldtype to something else?


Juergen
 Share

Recommended Posts

You can easily change any text in the admin by creating a new custom language.

Edit: strike that, You don't even have to create a new language. Just install the multi language support, and you're good to go.

Link to comment
Share on other sites

But I only want to change the text for this type of template (eventpage) not at all for this field. I use the same field in several templates and I want to change the text depending on the content (fe New event category, New price category and so on).

Link to comment
Share on other sites

You could use a replace hook on renderAddable().

But, based on your screenshot above...

You are not using a core Page inputfield. Looks like the InputfieldChosenSelect module, which has it's own method for adding new pages and does not render the core "Create New" link.

And I believe your "New" button is not core either, but actually rendered by the AdminPageFieldEditLinks module. These details do matter.

  • Like 3
Link to comment
Share on other sites

You are right. I use the InputfieldChosenSelect.module but it is used inside the fieldtype Page to render multiple selects. It doesnt matter if I use InputfieldChosenSelect, PageListSelect or another possibility of this fieldtype - the link text is always the same.

Here is a sceenshot of another option of this fieldtype:

Screenshot_9.jpg

This link is not part of AdminPageFieldEditLinks it is part of the fieldtype Page where you can choose if a link to create new pages should be visible or not.

Link to comment
Share on other sites

6 minutes ago, Juergen said:

This link is not part of AdminPageFieldEditLinks it is part of the fieldtype Page where you can choose if a link to create new pages should be visible or not.

Have you already translated the string then? Because the core Page inputfield renders "Create New" by default, not "New": https://github.com/processwire/processwire/blob/master/wire/modules/Inputfield/InputfieldPage/InputfieldPage.module#L621

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...