BFD Calendar Posted September 24, 2015 Share Posted September 24, 2015 When importing pages from a csv file with ImportPagesCSV they are only active in the default language. Is it possible to make them active all at once in all languages, on import or afterwards? I tried ProcessBatcher but it doesn't support this. Maybe someone has another solution... Link to comment Share on other sites More sharing options...
LostKobrakai Posted September 24, 2015 Share Posted September 24, 2015 https://processwire-recipes.com/recipes/activate-all-languages/ Link to comment Share on other sites More sharing options...
SiNNuT Posted September 24, 2015 Share Posted September 24, 2015 I don't think ImportPagesCSV supports this, but it wouldn't be hard to run some code afterwards via the API: https://processwire-recipes.com/recipes/activate-all-languages/ (adjust to your needs) edit: beaten by LostKobrakai Link to comment Share on other sites More sharing options...
LostKobrakai Posted September 24, 2015 Share Posted September 24, 2015 But more elaborated than mine. Link to comment Share on other sites More sharing options...
BFD Calendar Posted September 26, 2015 Author Share Posted September 26, 2015 I'm importing students names for a school website, so only the 'students' template needs to be active in all languages. I can find that in the script but my next question is where I can find the page-creation API script to add the code. Link to comment Share on other sites More sharing options...
LostKobrakai Posted September 26, 2015 Share Posted September 26, 2015 You can just run this code after you imported your students as usual. Paste the code in /site/templates/admin.php before the existing line in it. This file is called for each request to the admin UI and it's a simple place for one time code. Alternatively you could also use a manually created /site/ready.php file (since pw version 2.6.7), which would be called on each request to processwire. Change up the $pages->find() call in the script and visit any site in the backend. After that just comment out the script lines, so they won't get executed twice, and check if every languages are now active. Link to comment Share on other sites More sharing options...
BFD Calendar Posted September 26, 2015 Author Share Posted September 26, 2015 Great to learn something new and very useful again. School is on Monday so I'll try it then. Thanks! Link to comment Share on other sites More sharing options...
BFD Calendar Posted September 28, 2015 Author Share Posted September 28, 2015 Worked like a charm with ready.php 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