[Feature Request] Change names of objects in the hierarchy (eg, "Books" to "Products")
It would be valuable to have a simple UI-accessible way to rename the types of objects in the wiki hierarchy. I wanted to change from Books -> Chapters -> Pages, to Products -> Features -> Pages. I had to change these in the localization files so it'd be nice to have a simpler way to mass-change these names.
Note: This will have to change URL routes as well. @bensulli did you manage to do this?
Sadly no, I'm not a developer, this is just something I'd find valuable.
Good point about the URLs though, might be tough to ensure those stay functional after the change.
I'm going to attempt it tomorrow, so I'll keep you posted if it works and how I did it.
On Wed, Jul 26, 2017 at 1:47 AM Ben Sullivan [email protected] wrote:
Sadly no, I'm not a developer, this is just something I'd find valuable.
Good point about the URLs though, might be tough to ensure those stay functional after the change.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BookStackApp/BookStack/issues/406#issuecomment-317797474, or mute the thread https://github.com/notifications/unsubscribe-auth/ARj5GYgoF_9ftHVjvVOPLRzDHpikQs0wks5sRhwlgaJpZM4NsJhI .
@bensulli I managed to complete it - the live demo is at http://18.220.76.71/ (it won't be up long) - as you can see I changed Books/Chapters/Pages to People/Series/Interviews (I was particularly worried about series since the plural and singular forms are the same and could cause problems, but I haven't found it yet). You can see that the routes have changed as well. You mentioned you're not a developer so I wrote some steps and can help you further if you contact me privately.
This assumes an already-installed instance of BookStack. I used a fresh AWS Ubuntu 16.04 instance with the BookStack install script. Warning: I haven't fully debugged or tested this comprehensively, so approach with caution and YMMV. This is a signpost, not official documentation. Additionally, running database migrations and rollbacks WILL WIPE YOUR DATABASE.
- First, roll back the database migrations since the databases are also being modified. In the bookstack directory, run
sudo php artisan migrate:reset. - Next,
cdout into the parent directory. Start with renaming Books. Run the following in order: a.sudo grep -rl --binary-files=without-match Books bookstack/ | xargs sed -i 's/Books/YOURNEWNAMECAPITALIZEDPLURAL/g'b.sudo grep -rl --binary-files=without-match Book bookstack/ | xargs sed -i 's/Book/YOURNEWNAMECAPITALIZEDSINGULAR/g'c.sudo grep -rl --binary-files=without-match books bookstack/ | xargs sed -i 's/books/yournewnameplural/g'd.sudo grep -rl --binary-files=without-match book bookstack/ | xargs sed -i 's/book/yournewnamesingular/g'e. Special step only for Bookssudo grep -rl --binary-files=without-match YOURNEWNAMECAPITALIZEDSINGULAR bookstack/ | xargs sed -i 's/YOURNEWNAMECAPITALIZEDSINGULAR/BookStack/g'-> This is because step b breaksBookStack, so this restores it. Also revert your changes for the .env, since this will change your database username. - This will break some things because files and folders also need to be renamed, not just their contents. These files and folders are located in
/app(e.g./app/Book.phpneeds to be renamed toYOURNEWNAMECAPITALIZEDSINGULAR.php),/app/Http/Controllers,/resources/views, and more. You could also presumably automate this using therenamecommand or do it manually. - In the bookstacks directory, run
sudo php artisan migrate. If there is an error, just follow the debugging message - I worked this out by correcting errors one by one. - Now visit your web page again. Play around and see if anything fails. The debug messages are great, so you should activate development environment and debugging in the
.envfile. - Repeat 1-5 for Chapters and Pages. For Pages, keep an eye out for
page_revisionsandpage_draftsas well - those files and folders need to be renamed too.
Notes: You will have to roll back the changes for the vendor/ directory (I just deleted it and reinstalled after each iteration), because those are dependencies. Additionally for app/Providers/PaginationServiceProvider.php and probably others that deal with actual site pages due to the unfortunate namespace clash.
Hope this helps anyone who wants to adapt this great piece of work. @ssddanbrown Hope this helps for implementation; it should presumably occur during setup only. It's a blunt approach and I'm sure there's a better method out there.
The above process will be overwhelming for users with no technical knowledge.. I think easing this process is necessary..
@bridgeyuwa the solution from @spaceraccoon describes how to change everything from "Book" to "
If you only need to change the url and the labels, it should be enough to modify the names inside the routes.php and modifing the lang files.
EDIT: damn i'm wrong - currently, the routes doesn't have a ->name() defined.
So the solution from above is currently the only one :)
Yep. Just wanted to leave this here for more technical users. It's a pain and you definitely need to do some tweaking on your own. @noxify Did your edit mean it wasn't enough to just change routes.php? I was thinking of trying that as well.
Yes it's not enough to change the routes - but this is based on the missing ->name() method in the routes.
I have created also an issue/feature request #475 - maybe we can use this as starting point :)
Just want to re-iterate for less technical viewers of this issue that the methods describe above will be reverted and/or cause issues when updating.
Thanks for the help all. The above is more or less exactly what I ended up doing (albeit my way was more laborious). I wrote this issue because I think it'd be valuable to have as a frontend option, even just during first-time setup.
Edit: Sorry, didn't mean to close. I do think this is a valid feature request still.
Am craving for this feature to be added to the next release
this would be indeed useful
indeed that would be useful
Been 1 year since this has been last mentioned, any news on this getting added to the front end for non-technical users (for me I'd want it so I won't need to manually redo these steps on every Bookstack update.)
This would be useful for me if it can be implemented in the future release!
I also just edited the language files, I guess that is a pretty good workaround. Do you think there are so much users who are aware of the urls? Of course it would also very much appreciate having the option to just rename the categories, but this means a lot of code work and even dynamic setup in all of the language files.
@ssddanbrown @Abijeet I could have a go at this if it isn't already in the works? Seems to be requested frequently enough that it would add value if it was available in settings.
Please, also note that translations in different languages might have three or even five different ending plurals for an entity in the hierarchy.
E.g. EN: 1 Book, 2+ Books SK: 1 Kniha, 2-4 Knihy, 5 Kníh etc.
POEdit has this solved, see their wiki: https://poedit.net/trac/wiki/Doc/PluralForms
On Wed, Apr 24, 2019 at 10:17 AM Christopher Wilkinson < [email protected]> wrote:
@ssddanbrown https://github.com/ssddanbrown @Abijeet https://github.com/Abijeet I could have a go at this if it isn't already in the works? Seems to be requested frequently enough that it would add value if it was available in settings.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BookStackApp/BookStack/issues/406#issuecomment-486119237, or mute the thread https://github.com/notifications/unsubscribe-auth/ACBHPTJDOLW4NMI2U62AV53PSAJSZANCNFSM4DNQTBEA .
@cw1998 Thanks for offering but I'm not sure this specific feature is something I want to support in the core project right now.
The current naming system is pretty core to what BookStack is, Supporting this would mean adding and maintaining another level of configurability that would effect every view and almost every URL. Every bit of UI development would have to consider this requirement and it will likely spawn its own set of issues and required user support if it was to be implemented. Additionally, implementing this would encourage BookStack use outside of the scope of the project definition which tends to have more of a strain on support and issue management here on GitHub and weakens what BookStack is.
Perhaps we can help achieve this in another way. We have the theme system, where views & icons can be overridden on a per-file basis. Maybe we can do something similar where translation strings can be overridden on a per-translation basis. We're already some language extension thing for the de_informal language so we might not be too far off. That way, if someone really wanted to, they could override all translations for hierarchy items. People could even share their translation override sets with others. Plus this system could be used for far more customisation than just hierarchy items, while keeping the core project focused.
That kind of aligns of where I'd like to take BookStack: Simple, configured and focused by default but flexible and extensible for those with the knowledge and effort.
You'd still have the original names in the URLs, which could be a deal-breaker for some, but may be okay for others.
I have recently setup BookStack for a community to evaluate as their new wiki, but the community managers feel that the terms "Shelves" and "Books" will confuse the users a bit UX wise. They're otherwise quite happy with what BookStack is and offers feature wise.
Additionally, implementing this would encourage BookStack use outside of the scope of the project definition which tends to have more of a strain on support and issue management here on GitHub and weakens what BookStack is.
What is meant by this? Because of the suggestion by this issues author for Books => Products? While allowing for substitutions, anything could be used... there are also practical ones, such as Shelves => Categories, Books => Topics. That wouldn't weaken what BookStack is would it?
A platform to create documentation/wiki content
The wiki for the community I'm assisting with for example has a few different sections of content they want to make available to users, which shelves would be suitable for, and each of those with their books with chapters/pages. It's just the terminology isn't ideal.
I don't mind it personally, and it's a neat analogy for organizing documentation, but I've never seen it described that way in other wiki/documentation myself. I believe being able to override it on page content via localization is better than nothing, and still make a difference. Beats having to manually maintain adjust the terminology like shown earlier in this issue.
Has any progress on what you've suggested been made since April? If not is it planned?