Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Ahh i was talking about a in b. In itself doesnt make sense at all.
  2. I actually tried it the first I did when it came out, it seemed to work, though silly and not tested further.
  3. I just commited a major update to this theme I use every day Improved page tree with some new icons. Changed login screen a bit. Changed content layout to have all content, title and tabs included with round corner and slight shadow... Made sure that everything works with field columns (had still some issues). Made the max width of layout a lot wider. I updated the first post with the lates screen. If you happen to find any bugs or problems, please let me know so I can fix it. Latest screen:
  4. Hey Jeff, welcome to the forums. It "would" certainly be possible to use language fields, but I would not recommend. Better to use alternative fields for mobile, or even separat tree. A a simple example have a "body" field for normal desktop, and a "body_mobile" field. So you'd add a check for mobile and have a $mobile var with the string "_mobile". And add that to the fields you need. echo $page->get("body$mobile"); Not sure if that's the best way to go, but certainly a simple one.
  5. I can confirm.
  6. Ryan you're my hero! Loaded, tested, works now. Happy.
  7. Hello mcmorry, are you still working on this? Mind creating a repo on github for this module, so we can collaborate more easily on this? (If you want, I could create one on my account. However... While playing around with multilang and this module I found a simple way to use sanitizer (which Ryan already modified to allow replacements). The slug method can be changed to: public function toSlug($str) { $str = mb_strtolower($str); // needed for uppercase cyrillic chars $str = $this->sanitizer->pageName($str, Sanitizer::translate); return $str; } Also has to change or add various code to support urlSegments and pageNum. So it doesn't throw an 404 but load the page before it reaches segments that aren't solved. I also changed the hook to $this->addHookAfter('Page::path', $this, 'mlUrl'); So the system internally also works, and no change is required to use mlUrl. It works great so far. I kinda collaborated with MadeMyDay over the weekend on this, as he's doing a website using this language urls together with the multisite module. So we made similar changes, altought he got more I think. He got it also working using both modules. So this could turn into an interesting alternative to multilanguage sites. Edit:: I also tried to find easy solution for defining published languages. So I created a page field that returns the proxy language pages as checkboxes. So you can turn a language off. The module then looks for this and throws an 404. To get this to work, navigation code, language switch, and all list generation has to consider those, but it works ok. A language switch would be a simple as: $lang = $user->language; $langname = $lang->name == 'default' ? 'en' : $lang->name; $user->language = $languages->get("default"); $st = $langname == 'en' ? " class='on'" : ''; echo $page->language_published->has($pages->get("/en/")) ? "<li><a$st href='{$page->url}'>EN</a></li>" : ''; $user->language = $languages->get("de"); $st = $langname == 'de' ? " class='on'" : ''; echo $page->language_published->has($pages->get("/de/")) ? "<li><a$st href='{$page->url}'>DE</a></li>" : ''; $user->language = $lang;
  8. I tried for hours to get markup pager nav to work in the search page. After I logged out to see what happens, it worked. It seems only when I'm logged in as superuser, it doesn't works when logged in as an editor. All I do is $matches = $pages->find("title|body|sidebar%=$q, limit=3"); $count = count($matches); if($count) { $out .= $matches->renderPager(); ... Anybody can confirm this? I tried in 2 installations. EDIT:: Ok I tried again and on an install without language fields installed AND language page title set, it works. After installing and switching "title" field to language page title field AND set superuser language to an alternative like german, the pagination stops working with a search like the above. The limit isn't recognized anymore only when I would do: $pages->find("title|body|sidebar%=$q")->find("limit=3"); And then the limit works but the pagination doesn't work anyway. So in other example in short, for guest user it works when I set the guest to default language, but when set to an alternative it doesn't. What's happening?
  9. I still can't seem to install the module. When I got to module page and click for new modules, I get a server error. 2012-05-28 07:09:52 admin http://.../processwire/module/ Parse Error syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM (line 16 of /.../site/modules/Shop/PaymentAbstract.php)
  10. My teflon theme is uptodate. If you use one that doesn't urge them to update their theme too.
  11. Hey Lars, it's done using the http://fancybox.net/
  12. Small hint to people using language packs. If you happen to have a custom admin theme installed, you need to add a translation for the /site/templates-admin/default.php to translate the admin top menu and profil, logout text. @yellowled the Translation/Language module itself seems missing, or is that not translatable yet? But so far great work!
  13. Just one issue for now, I can't install the pack with just using the zip from github. The readme.markdown is the problem. Edit: ah well, it installs it all .json even with the readme file it will just ignore it...
  14. Everytime I need to delete a long list of files or images on a page, I wish there were a button to toggle all to delete.
  15. Awesome work yellowled! Thanks so much for taking the time. Well at least you only have to do it once. Will for sure check it out and see if I spot something.
  16. OK, coming back to this Thanks Ryan, I'll pull request the tinymce module and js changes I've done to add a third party config textfield to add plugins from outside the core. Hope you'll find the time to pull it in - bramus_cssextras, mainly it's for fixing the tinymce internal style select, which doesn't work well with nested elements and is cumbersome to deal with. This plugin is context sensitive, as it only enables the style dropdown if you put cursor in an element that has a class specified. Like if you specify p.lead{} in your content.css, it will only be selectable if you select a paragraph. It also provides an solution to an issue where you couldn't add a class to the <ul> element in tinymce, because you can't select it. So if you click inside a ul list, the <li> element is usually selected and classes get appended to the <li> element and not the parent <ul>. Bramus solves this. WEll I don't know why I'm explaing this the x-time here on the forums The website explains it all and the demo works well to demostrate: http://www.bram.us/d...amus_cssextras/ ... The top row "style" is the regular style select. The disabled ".class" and "#id" menu select on the 3rd row is the one from bramus_cssextras. Click inside the list in the text and see the menu gets enabled and only shows classes that can be added to the current selected element. Pretty cool compared to tinymce default style if you ask me.
  17. You could get the page name inputfield replacements settings like this: $pn = $modules->get("InputfieldPageName"); if(array_key_exists('replacements',$pn->data)) $replacements = $pn->data['replacements']; else $replacements = InputfieldPageName::$defaultReplacements; print_r($replacements); Edit: There was some discussions about this subject and to wether sanitizer should support the replacements from page name inputfield. And it seems it's still open to make it consistent throughout the system. See thread here for Ryan's thinking http://processwire.c...t-module-issue/
  18. Hey mcmorry Thanks again for putting this together. Some feedback. I guessed it, but newcomers maybe could have problems understand that URLsegments needs to be enabled in PW template settings to make it work. Maybe suggest the proxy pages could also be made hidden, to avoid showing up in the navigation. The module unfortunately doesn't work well with special chars in many languages. Like Umlauts ÜÖÄäöü ... àåéê and a lot more. I end up with /de/1001_-ber-uns/ instead of /de/1001_ueber-uns/.. Note that those conversion are used in the default title -> name relation when creating a new page, and can be configured in the page name inputfield module in processwire. Maybe there is a way to get that config from the module loaded to do the slug. Or if not, add it to this module locally. The mlUrl() seems to work expect the link for homepage "/" doesnt work. It has "". Also to avoid the problem of having doubles in alternative languages, id feature has to be always enabled. As there's nothing preventing me from entering same title for two pages under same tree. Or maybe there's an easy way to prevent it with a hook and do some additional validating on page title language fields. Some idea I had would be to have an install method in the module to install the needed template with urlSegments enabled and prepare the default and other proxy pages according to the language settings in PW.
  19. Welcome mcmorry, and thanks for making this module. The following is maybe more directed to Ryan, but everyone it welcome to think about something. What would it mean to implement this feature in the core? Would it be a lot of work to change the url mapping to support language name for a page? (edit: or even possible or making sense). I mean since you already have implemented the multilang fields, and given that there's a page title multilang field, I find it now strange that such a module is required to implement language urls which is a "must have" feature, regarding SEO, for a good multilanguage site. Sorry to bring this up here a little late. I just am thinking about this subject a very long time and not only since PW, but haven't really payed attention to the multilang field and title and that something seems missing as the "last" brick for a on-one-page multillanguage solution (with speaking urls) out of the box. I'm ever since using separate language trees to build sites and it works very well and flexible, consistent, fast, not so polluted page edit mask, etc. so I'm more the one heading towards the concept of Olivers language module with synced, linked multitrees. But this is a different subject and maybe discussed in the other room.
  20. Have you created an image field and then set the inputfield (on field input settings tab) to "cropimage"? Or changed an already setup image field to use cropimage inputfield? If so, it won't work, you have to create a field using fieldtype "cropimage" from the start. I recently ran into this problem.
  21. Sure you can // get all pages that have at least 1 quote $res = $pages->find("employee_quotes.count>0"); // add all quotes to an PageArray $allquotes = new PageArray(); foreach($res as $r) $allquotes->add($r->employee_quotes); // shuffle or whatever you please $allquotes->shuffle(); // output all foreach($allquotes as $q){ echo "<p>$q->employee_quote</p>"; }
  22. Thanks Ryan! Then you have to take look at the $page->created_users_id, it returns the modified user id and modifiied_users_id the created user id... Think you missed it in the previous posts. Is this a bug?
  23. Thanks for testing antti! I was also thinking this, but my testsite has only 10 direct children in "/"... EDIT: *Logs out with editor and logs in with admin* It's actually 14 including trash and admin etc, same like the amount of the result.
  24. Ryan, I was testing yesterday with a different code. While testing with this, can you explain why the following happens: When I use this: $results = $pages->get("/")->find("modified_users_id|created_users_id=41"); echo "res: " . $results . "<br/>"; I get this: res: 1002|1004|1008|1010|1112|1143|1161|1163|1170|1193|1194|1196|1240|1257 When I use: $results = $pages->find("modified_users_id|created_users_id=41"); echo "res: " . $results . "<br/>"; I get this: res: 1|1001|1002|1003|1004|1005|1008|1010|1112|1143|1161|1163|1165|1170|1176|1177|1188|1193|1194|1196|1197|1202|1240|1257 I think that's why I got so confused. This does only happen when echo the result, it is not this way when using foreach... (ok forget this, I must be dreaming) Edit: sorry changed first post code to correct.
×
×
  • Create New...