adamspruijt Posted July 17, 2013 Author Posted July 17, 2013 One idea came up, and was just curious about the feasibility of it: What if the "active" tab was based on the current user's language? So if I had my language set as Spanish, I'd see the Spanish tabs active (rather than default language tab) when editing a page? Thanks for suggesting this Ryan. I remember pondering the idea early on but dropped it at the time to avoid getting my self overwhelmed with ideas, I sometime spend too much time thinking of the millions of thing I *could* do instead of just doing any of them. I add it ASAP.
ryan Posted July 17, 2013 Posted July 17, 2013 I've been putting some thought into it here, and am thinking we need a config.user.language variable added to PW's JS config variable. I don't yet see another way for LanguageFieldTabs to identify the current user's language. Let me know if this sounds like what you'd need, or if you had another idea? Also, I just submitted a PR to you that makes the empty vs. populate state of LanguageFieldTabs work with CKEditor inline mode, and also makes makes that state a little more more useful for the page name (2.3.2+/dev branch). 2
adamspruijt Posted July 17, 2013 Author Posted July 17, 2013 I've been putting some thought into it here, and am thinking we need a config.user.language variable added to PW's JS config variable. I don't yet see another way for LanguageFieldTabs to identify the current user's language. Let me know if this sounds like what you'd need, or if you had another idea? Also, I just submitted a PR to you that makes the empty vs. populate state of LanguageFieldTabs work with CKEditor inline mode, and also makes makes that state a little more more useful for the page name (2.3.2+/dev branch). That sounds like what I'll need for sure Ryan. I was going to try and get around this but I think the best solution is to have the default tab selected in version of PW that offer the "config.user.language variable" and otherwise maintain the current behavior. 1
ryan Posted July 20, 2013 Posted July 20, 2013 That sounds like what I'll need for sure Ryan. I was going to try and get around this but I think the best solution is to have the default tab selected in version of PW that offer the "config.user.language variable" and otherwise maintain the current behavior. I took a closer look at this and realized we'd need to set that config.user variable in the admin theme, and that it'd be better not to have an admin theme dependency for this module. So what I did instead is updated your module to pass along the active tab index in it's JS settings (config.LanguageFieldTabs.activeTab). It determines the active tab based on: if a GET variable is present called "language", containing the ID of a language, it uses that. Otherwise it uses the current user's language. This way you can have it focus on the right language tabs when a user clicks "edit" from the Spanish version of a page, for example. Here is what my edit link looks like on the front end: echo "<a href='{$config->urls->admin}page/edit/?id=$page->id&language=$user->language'>Edit this page</a>"; If there is no "language" GET variable specified, then it just defaults to the current user's language, whatever that may be. The end result is that the tabs always focus on the right language. In testing here so far, it seems to work quite nicely. I just sent over a pull request for this update. 2
Soma Posted September 24, 2013 Posted September 24, 2013 I figured this doesn't trigger when using good old Fredi. The nice thing it would be simple to add support cause of modulotastic PW if($this->modules->isInstalled("FrediProcess")) { $this->addHookAfter('FrediProcess::execute', $this, 'loadTabs'); } Shall I make a PR or would you consider adding it? Thanks 1
apeisa Posted September 24, 2013 Posted September 24, 2013 Fredi likes when he gets special treatment like that.
Soma Posted September 25, 2013 Posted September 25, 2013 @adamspruijt long time no see! still around? Also wanted to note that if you download the module from modules repository I still get 1.0.7, but the newest is 1.0.8! 1
adamspruijt Posted September 25, 2013 Author Posted September 25, 2013 pull request works, i'll take a look at the download issue EDIT: downloaded from directory and got 1.0.8 ... not sure why you didn't, sorry.
Soma Posted September 25, 2013 Posted September 25, 2013 Sorry maybe I got an older version indeed. I install VIA ModulesManager
ryan Posted September 29, 2013 Posted September 29, 2013 Do you guys think it makes sense to bring LanguageFieldTabs into the core? So far I haven't come across a multi-language site install where I wouldn't want it, so starting to wish it was just there by default. 6
adamspruijt Posted September 30, 2013 Author Posted September 30, 2013 I would be really happy to see this in core. 1
Soma Posted October 1, 2013 Posted October 1, 2013 Do you guys think it makes sense to bring LanguageFieldTabs into the core? So far I haven't come across a multi-language site install where I wouldn't want it, so starting to wish it was just there by default. Only if you take HelperFieldLinks, FormSaveReminder, PageEditSoftLock too @adamspirit I'll make a pullrequest to add support for Fredi. 1
arjen Posted October 2, 2013 Posted October 2, 2013 Great idea! Not to hijack this thread, but FormSaveReminder would be a nice addition too - for all users.
adrian Posted October 31, 2013 Posted October 31, 2013 Just noticed that if you uninstall language support, it doesn't also uninstall "Languages Support - Tabs". It gives a couple of php warnings/notices from the tabs module file. BTW, I am talking about the latest PW dev version where this is now a core module.
valan Posted January 23, 2014 Posted January 23, 2014 I've recently migrated from PW 2.3.1 to PW 2.3.11. Everything seem to work fine except this module. I've re-installed it but w/o success. What could be a reason?
Soma Posted January 23, 2014 Posted January 23, 2014 This module is now in core languages module section and shouldn't be installed in site anymore!
valan Posted January 23, 2014 Posted January 23, 2014 OK, I've uninstalled it but result is the same - no tabs...
valan Posted January 23, 2014 Posted January 23, 2014 ups... I didn't realize that modules now have separate Core tab finally perfectly works! Thanks, Soma. 1
psycho666 Posted February 20, 2014 Posted February 20, 2014 Hello guys, my name is David and i´m new here.Processwire is great CMS but i have a problem with the LanguageFieldTabs. The are not displayed.How should I install the tabs exactly? Does anyone have a step by step guide? I have followed these instructions: Place the .module file in your /site/modules/ directory. If the module contains more than one file (like supporting .css or .js files for example), it should be created in it's own directory under /site/modules/ with the same name as the module. For instance, the AdminBar module and supporting files should be placed in /site/modules/AdminBar/. Login to your ProcessWire admin and click on the Modules tab. Click the check for new modules button. Click the install button next to any of the new modules that you want to install. unfortunately there is no further description. Best Regards David
kongondo Posted February 20, 2014 Posted February 20, 2014 (edited) David, Welcome to PW and the forums. This module is now part of the core so you don't need to install it this way. If you are using PW 2.4 (i.e. the latest version) you should see it under the "Core" tab under /modules/. I believe its called "Languages Support - Tabs" (see category Language) Edited February 20, 2014 by kongondo 3
psycho666 Posted February 21, 2014 Posted February 21, 2014 Thanks for your Answer, i installed it under the Core. With the site title and the other it works, but not with the Body field. Do I need to do something special with the body tag?
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