Juergen Posted September 28, 2016 Share Posted September 28, 2016 Hello @ all, I use a fieldtype "Page" to categorize content. Is it possible to change the "New" text to something else like "New sub-category" and if it is possible how? Best regards Link to comment Share on other sites More sharing options...
diogo Posted September 28, 2016 Share Posted September 28, 2016 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 More sharing options...
Juergen Posted September 28, 2016 Author Share Posted September 28, 2016 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 More sharing options...
pmarki Posted September 28, 2016 Share Posted September 28, 2016 You could do this by JavaScript using custom admin files 2 Link to comment Share on other sites More sharing options...
Juergen Posted September 28, 2016 Author Share Posted September 28, 2016 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. Link to comment Share on other sites More sharing options...
Robin S Posted September 28, 2016 Share Posted September 28, 2016 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. 3 Link to comment Share on other sites More sharing options...
Juergen Posted September 28, 2016 Author Share Posted September 28, 2016 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: 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 More sharing options...
Robin S Posted September 28, 2016 Share Posted September 28, 2016 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 1 Link to comment Share on other sites More sharing options...
Juergen Posted September 28, 2016 Author Share Posted September 28, 2016 You are right! I dont know where it comes from. Link to comment Share on other sites More sharing options...
tpr Posted September 28, 2016 Share Posted September 28, 2016 Live search to the rescue: https://processwire.com/blog/posts/pw-3.0.23/#new-phrase-search-for-language-translation 2 Link to comment Share on other sites More sharing options...
Juergen Posted September 28, 2016 Author Share Posted September 28, 2016 Oh yes. It really comes from the AdminPageFieldEditLinks.module. So its time to hook into ! Link to comment Share on other sites More sharing options...
adrian Posted September 28, 2016 Share Posted September 28, 2016 This might be a feature request. Similar functionality already exists for the Profields Table field: I understand diogo's suggestion, but surely this is not really a multi-language question, is it? Link to comment Share on other sites More sharing options...
Juergen Posted September 28, 2016 Author Share Posted September 28, 2016 1 hour ago, adrian said: This might be a feature request. Similar functionality already exists for the Profields Table field: Added to feature requests. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now