Jump to content

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


Recommended Posts

Posted

Hello @ all,

I use a fieldtype "Page" to categorize content.

Screenshot_8.jpg

Is it possible to change the "New" text to something else like "New sub-category" and if it is possible how?

Best regards

Posted

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.

Posted

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).

Posted

I know but I have hoped that there is another way. I have a multilingual site and changing the text with JS to every language is not what I prefer.

Posted

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
Posted

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.

Posted
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
Posted

This might be a feature request. Similar functionality already exists for the Profields Table field:

Screen Shot 2016-09-28 at 7.36.03 AM.png

I understand diogo's suggestion, but surely this is not really a multi-language question, is it?

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
  • Recently Browsing   0 members

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