Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/29/2012 in all areas

  1. Wow, I'm really impressed on how much interest there is for this module Sorry if I didn't work on it yet, but I'm focused on a important milestone of a different project that, I hope, should be released tomorrow. I really would like to work with you to improve this module and of course if you could host it on GitHub will be the best solution. I've seen that I don't have so much experience on PW, but I'll do my best. Thanks again
    3 points
  2. Thanks, I will make the same change in the core, replacing the second 'true' param with 'Sanitizer::translate' in the setupNew() function. The translate option was added to the sanitizer pretty recently.
    2 points
  3. I am - and I think others too - very impressed about this module. The issues you are solving are one of the hardest there is and go pretty deeply into the PW. So great respect from here and warm welcome to the community!
    2 points
  4. 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;
    2 points
  5. 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.
    1 point
  6. hehe, when posting my answer the structure screenshot wasn't there. If there are only children of a kind it is easier/better to use ->children()
    1 point
  7. Ryan you're my hero! Loaded, tested, works now. Happy.
    1 point
  8. Like with most CMS, you would convert your HTML into a PW template, basically replacing anything which will be generated dynamically by PW with PHP tags/PW API calls. There's a standard template in /site-default/templates/ of the PW download archive which you can use as a boilerplate. Have a look at the .php/.inc files in there. Basically, you need to reproduce your site's HTML structure there, replacing the parts which will later come from PWs database with the appropriate PHP tags/API calls. You can also replace references to the standard template's CSS and JS files with references to your own CSS/JS, or you can just leave the CSS/JS references and replace the content of those files with your own CSS/JS. As it is most of the time with PW, it's entirely up to you. (And that's great about PW, at least in my book.) Now, what's generated dynamically? Well, that really depends on what you want PW to do. Typically, all page content and the navigation are generated dynamically. You'll find examples for generating a navigation in the standard template, but there's also soma's excellent MarkupSimpleNavigation module. The standard template also has templates for a search function and a sitemap – you might or might not need those in your site. Hope that clears that part up a little.
    1 point
  9. Although I'm sure many PHP veterans already know, that's Hebrew for :: It does baffle me why they've never changed the error name.
    1 point
  10. I finally had a chance to take a stab at this - and I'm pleased with what I was able to do. I added the functionality directly in the core - in InputfieldPage.module as Ryan said I would have to do. I decided to leave the Label Field intact and simply add a couple more configurable fields. It makes sense to simply replace the Label Field (InputSelect) with the Multiple Label Field (AsmInputSelect) I added, but didn't want to remove the core functionality in case I missed some trickle-down implications. (Ryan, would there be any?) What this does is add two configuration fields to the Page fieldtype. The first allows you to define multiple fields to use as the label for selectable pages. It simply gives you a combination of the selected values imploded with " - ". The second field I added (a text field) allows for ultimate flexibility; you can define the pattern to use for the label, so you can do things like: {title}, {parent->title} Anyway, here's what I did in the InputfieldPage.module: After line 28 in the $defaultConfig array, add the following: 'labelFieldNames' => '', 'labelFieldNameCustom' => '', Replace line 114 in the getInputfield() function with the following: if ($this->labelFieldNameCustom) { $label = preg_replace('/{(.*?)}/ie','$child->$1', $this->labelFieldNameCustom); } else if ($this->labelFieldNames) { $labelItems = array(); foreach ($this->labelFieldNames as $f) { $labelItems[] = $child->get($f); } $label = implode(' - ', $labelItems); } else { $label = $this->labelFieldName ? $child->get($this->labelFieldName) : $child->name; } After line 367 in the ___getConfigInputfields() function, add the following: // MULTIPLE FIELD LABELS $field = $this->modules->get('InputfieldAsmSelect'); $field->setAttribute('name', 'labelFieldNames'); $field->setAttribute('value', $this->labelFieldNames); $field->label = 'Label Field (Multiple Page Fields)'; $field->description = "Select the page fields that you want to be used in generating the labels for each selectable page. This setting supercedes the single field label option."; $field->collapsed = Inputfield::collapsedBlank; if ($this->fuel('fields')->get('title')) { $field->addOption('title', 'title (default)'); $field->addOption('name', 'name'); $titleIsDefault = true; } else { $field->addOption('name', 'name (default)'); $titleIsDefault = false; } $field->addOption('path', 'path'); foreach ($this->fuel('fields') as $f) { if (!$f->type instanceof FieldtypeText) continue; if ($f->type instanceof FieldtypeTextarea) continue; if ($titleIsDefault && $f->name == 'title') continue; $field->addOption($f->name); } $inputfields->append($field); // CUSTOM FIELD LABELS $field = $this->modules->get('InputfieldText'); $field->attr('name', 'labelFieldNameCustom'); $field->attr('value', $this->labelFieldNameCustom); $field->label = "Label Field (Custom)"; $field->description = "Define the page fields (enclosed in braces) that you want to be used in generating the labels for each selectable page. This setting supercedes the multiple field label option."; $field->notes = 'Example: {title}, {parent->title}'; $field->collapsed = Inputfield::collapsedBlank; $inputfields->append($field); It's working beautifully for me! Ryan - does it look like I missed anything? I saw that labelFieldName was referenced in the ___renderAddable() function, but I wasn't sure what that does.
    1 point
  11. Thanks MadeMyDay, the most of the cyrillic characters are already there by default. Meanwhile I have found that the PageName input field replacement was NOT enabled by default in $sanitizer->pageName(). I have modified the Pages->setupNew() method to enable it and this allowed me to use "Create new" feature with not (a-z) characters.
    1 point
  12. Absolutely awesome film with Hulk stealing scenes all over the place with his comedy antics.
    1 point
  13. Coincidence - I just downloaded 'Getting Real' a couple of days ago. It's now a freebie - http://gettingreal.37signals.com/.
    1 point
  14. 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.
    1 point
  15. Hm, it's true... it doesn't. There is a browser extension that does. I use it on gmail also and it's good: http://www.afterthedeadline.com/ it disables formatting while checking, but it's recovered when the spellchecking is finished edit: apparently there's even a version for tinymce! http://www.afterthed...latform=TinyMCE
    1 point
  16. I had some time at hand and nothing else to do, so I went ahead and translated some more. All 70 language files translateable as of PW 2.2.2, to be exact. Someone please double-check these. I'm sure they're far from perfect, and I'll gladly accept any suggestions for better translations or hints to typos. I'll also continue to refine some of the translations, but after this little bulk translation marathon, I need a break. I also put them in a GitHub repo: https://github.com/y...wled/pw-lang-de
    1 point
  17. This template was made before the column feature was introduced. So look in the code, the columns have a special class (guess something with "column", I am not at my computer now). Just apply a "float:left;" to that class in the admin's CSS. edit: I think it is the class "InputfieldColumnWidth". Look for that in the ui.css or add this: .Inputfields > li.InputfieldColumnWidth { float: left; clear: none; margin-top: 0; margin-left: 1%; } .Inputfields li.InputfieldColumnWidthFirst { clear: both; margin-left: 0; }
    1 point
  18. You use $image->url where you should use $thumb->url
    1 point
  19. Since I'm going to need these in a project soon, I took the liberty of updating these a bit. I didn't edit any of Nico's translations, I just cleaned out some abandoned ones and filled in most of the blanks (not the ones which make perfect sense untranslated). For starters, it would be great if other German native speakers could check these out. I'm sure there's a typo here or there. de-de_2012-05-26.zip
    1 point
  20. Update: I now have PW running on nginx. It took a little longer than expected & I'll post more when I've investigated it further.
    1 point
  21. Sneak Preview (everything configurable, styling mostly controlled by admin theme):
    1 point
  22. Googling for alternatives to Wordpress. Found it on alternativeto.net website
    1 point
  23. While developing my dashboard module I came across a lot of difficulties when building a configurable filter for selecting pages for the last pages widget. Some things I discovered: "or" filter in native page fields didn't work. Fixed by Ryan in the last commit (Big thanks!): https://github.com/ryancramerdesign/ProcessWire/commit/70093241b2cbfe7cae79f28531c1a5df1a572169 It is was somehow difficult/impossible to use get('/')->find(...). This resulted in weird results where direct children were not in the results array. Should also be fixed (not tested). There is an undocumented selector "has_parent" which looks for a parent up to the root. Quite handy! So "has_parent!=2" removes all admin pages (except admin itself, add id!=2 for that) from a select (thanks @Soma!). The "user" which created the standard pages is not the superuser. This was the reason I doubted my results because I thought the superuser would have created everything. Me stupid. The inputFieldSubmitButton module generates a button which gets doubled in the admin head section. Couldn't find the place where this happens until I found out that this is generated with Javascript. Me stupid again. Important rule for selectors: First "has_parent" (if needed), second "include=all" (if needed), then the other filters. And in the end "sort" and then "limit". Not sure about this, but this works for me, so I have only one selector which seems to be correct. For example the latest pages for a specific user which are not admin pages (and no trash): has_parent!=2,id!=2|7,include=all,created_users_id|modified_users_id=41,sort=-modified,limit=10 Looks easy, but wasn't (at least for me)
    1 point
  24. $class = $child === $page->rootParent ? " class='on'" : ''; is a short way of writing if($child === $page->rootParent) { $class = " class='on'"; } else { $class = ''; } $page->rootParent gets the ancestor that is closer to the root (a direct children of the homepage). If you change the homepage variable to a something different from the root, they will never match. For this to work you have to replace $page->rootParent for this page's ancestor that is closer to /en/. Put something like this after the first lines: foreach($page->parents as $v) { if($children->has($v)) { $newRootParent = $v; } } Then replace $page->rootParent by $newRootParent. I'm not on my computer, and I can't test this right now, so, no guarantees here
    1 point
×
×
  • Create New...