BitPoet Posted December 18, 2014 Share Posted December 18, 2014 Here's my first serious attempt at a PW module. I have the need that pages shouldn't be "published" in all languages at once, so I've put together a PageLangPublish module. It adds both buttons for publishing/unpublishing of each language to the page tree and status icons (from image fields added to each page in admin/languages) next to the page title in the tree. You can find the module at github under https://github.com/BitPoet/PageLangPublish I've probably done a lot of things quite awkwardly (even incorrectly) there, so I'd be grateful for any pointers and ideas. The module also adds a hookable isLanguageViewable method to the Page class. Usage example: $topnav = array(); foreach($homepage->children as $item) { if( $item->isLanguageViewable($user->language) ) { $topnav[] = "<a class='topnav' href='{$item->url}'>{$item->title}</a>"; } } echo implode(" | ", $topnav); Here's a screenshot: 5 Link to comment Share on other sites More sharing options...
heldercervantes Posted December 31, 2015 Share Posted December 31, 2015 This looks cool and I have this need in just about every site I make. But I find it strange that this post is a year old and module isn't listed on the modules directory. Does that mean there are other modules / approaches to this problem? EDIT: Looks like I've jumped the gun there. Just seen it's in alpha stage on github. Bummer, alpha is scary for client work. Link to comment Share on other sites More sharing options...
BitPoet Posted January 3, 2016 Author Share Posted January 3, 2016 I've been tweaking this a bit to work in sync with active/inactive statuses, added reasonable default behaviors for trying to access pages in non-viewable languages and made ui interaction a bit smoother, so the code has grown quite a bit. I still need to tidy it up a bit, adapt the installer/uninstall methods, add comments to the code and such and do some testing with the latest PW versions. Once I've found the time for that, it shouldn't be long until I can release a production-ready version, which should be towards the end of January. 1 Link to comment Share on other sites More sharing options...
heldercervantes Posted January 4, 2016 Share Posted January 4, 2016 Sounds great BitPoet. Looking forward to the updates. IMO this feature is essential for multi language sites, and I'm sure I'll be using in basically every project I make. It's weird that this didn't generate more response from the forum. Please update this thread when you release a new version. Link to comment Share on other sites More sharing options...
heldercervantes Posted October 18, 2016 Share Posted October 18, 2016 Hey Bitpoet. Any progress on that sweet module of yours? Link to comment Share on other sites More sharing options...
BitPoet Posted October 19, 2016 Author Share Posted October 19, 2016 It's actually still on the list, but there were a lot of other things that took priority. While I did incorporate some of the changes mentioned above, I'm currently not happy with the behavior in the page list, so this needs some extensive and careful tinkering. Currently, changing online/offline status from the page list reloads the tree each time, which is too time consuming. Since it's in use in production in an ever-growing intranet page, that will become urgent sooner or later, so chances are high I can fit the overhaul in before Christmas. 2 Link to comment Share on other sites More sharing options...
arjen Posted October 19, 2016 Share Posted October 19, 2016 On 1/4/2016 at 4:07 AM, heldercervantes said: It's weird that this didn't generate more response from the forum. Indeed strange. To me this is a must-have when dealing with multi language sites. Right now there is not really a way to overview all languages from the PageTree. 4 hours ago, BitPoet said: I can fit the overhaul in before Christmas Great! In case you need any testing please let me know. 1 Link to comment Share on other sites More sharing options...
tpr Posted October 19, 2016 Share Posted October 19, 2016 @BitPoet How you managed to put the flags on the pagelist - have you arbitrarily choose the flags? I guess this is something one should take care of (eg. via an extra image field). Link to comment Share on other sites More sharing options...
BitPoet Posted October 19, 2016 Author Share Posted October 19, 2016 3 minutes ago, tpr said: How you managed to put the flags on the pagelist - have you arbitrarily choose the flags? I guess this is something one should take care of (eg. via an extra image field). The module adds two image fields to the language template, one for published and one for unpublished status. 1 Link to comment Share on other sites More sharing options...
tpr Posted October 19, 2016 Share Posted October 19, 2016 Perhaps one field could be spared using CSS only for the inactive language. Or using the first 2-3 chars of the language title/name. Link to comment Share on other sites More sharing options...
mciccone Posted November 28, 2016 Share Posted November 28, 2016 Just wondering if there had been any progress on this module to get it past Alpha? It would be the perfect solution for a site I'm currently working on. Link to comment Share on other sites More sharing options...
BitPoet Posted November 29, 2016 Author Share Posted November 29, 2016 I'm still in the middle of an almost complete rewrite. I still plan to have it finished by Christmas, but I don't dare to give a more precise estimate right now. As soon as that's finished, I'll release it as a beta and do some heavy-load testing in our intranet to confirm its stability. 3 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