Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. http://processwire.com/talk/topic/3299-ability-to-define-convention-for-image-and-file-upload-names/
  2. You sentence doesn't make much sense, but anyway, the image fields max width and height settings is for when uploading images and nothing else.
  3. There's a max width and max height settings on the image field input configuration. So use size() and keep aspect ratio you can leave on empty or 0, or use width(). $image->size(450,0)->url
  4. PW set's the locale with if($locale != '0') setlocale(LC_ALL, $locale); (LanguageSupport.module) and not LC_CTYPE ? ini_set("default_charset","uft-8") I think is used for header that is sent to browser, and you can also set it in htaccess.
  5. I can now see what you mean and it has to do with the setlocale. For german you have this set to de_DE, and in the default (if it's english) either you have entered en_EN or C (default), and it seems this has an effect on multibyte chars and string functions in PHP. http://stackoverflow.com/questions/5231620/what-does-set-localelc-ctype-c-actually-do around this issue. But since you're using different languages I don't see an issue using mb_'s in your templates.
  6. What I still don't get ( and I couldn't login on your site) is you're speaking of admin or front-end when you say it works/not works? Also do you use language fields or what setup do you have, because I see no language on your site. I can't reproduce this, nor have I experienced this when working with languages in PW.
  7. Ah, now I see you used strtolower(string) which isn't multibyte compatible and since in utf8 cyrillic chars are multibytes it doesn't work correct. It's a string manipulation in PHP and if you have special chars like "üäö" the returned string will get screwed. There quite a lot of string function that do this, and it's normal and expected behavior and there's nothing wrong. So as slkwrm suggested you have to use mb_strtolower(string). I'm not sure I understand what you mean with logged in vs logged out, because that doesn't make a difference. Edit: in fact you'll see the mb_ version of string function used all over in PW core if it's supported. For example https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/Sanitizer.php#L42
  8. Maybe best if you open a new thread with your question in the PW support forum...
  9. There's no thing as to change a file field to a image field on runtime just for if there's an image. There's no standard way as it's not meant to be used that way. The only easy way would be to create a new Pageimage with the file. This requires an image field attached to the page in question so it can use that. foreach($page->files as $f) { if($f->ext == 'jpg'){ $image = new Pageimage($page->images, $f->filename); echo "<img src='{$image->size(100,0)->url}'/>"; } }
  10. This isn't as simple as it may seems and even programmers have their difficulties, it can get very tricky and some approaches may get very inefficient. One way could be to get the oldest and newest article and cycle months and years, and output a menu entry only if at least an article found within that month. Before anyone going to code 1 hours for what you need, is the structure of your article as you show in your example already? Meaning are articles already in a date structure? /dagboek/2005/07/1/article1 ... If so, it would be very easy. If not, rendering the menu is a lot more complex and you also will need to use urlSegments for showing a list of articles of a month.
  11. Also never experienced this, and no clue as to why. It shouldn't make a difference if logged in or not. Try uncomment $config->dbSetNamesUTF8 = true; in site/config.php
  12. From this very thread http://processwire.com/talk/topic/530-profile-export-module-also-upgrade-pw-20-to-21/?p=4263
  13. Shouldnt it be $config->urls->templates ...? Path is for php and file system.
  14. If a field is used in a template you cant delete it anyway.. I don't think using tags would help that and I dont understand what davep problem has to do with op.
  15. I see the same on Mac as Ryan. NEver seen that, and let me says 3.5 mb for a bit of text is quite huge. Apart from that it will be out of date pretty quickly now.
  16. http://www.w3fools.com/
  17. I noticed soemthing strange I don't think is very good. Add a date or email field to a template (ie basic-page). After filling the field on one page and looking at DB field table everything is ok, there's a new entry, the value is saved with the page id. Now if you remove the field from the template, you get prompted if you really want to, and after hitting ok, it shows messages for each page that uses this template that the field was deleted. So far so good. Now but you wouldn't expect that if you look at the field table, suddenly there's an empty entry for one and each page that has this template! Oops. And this empty data will stay there until you delete the field itself. It happens so far for date and the email field, for text field it seems ok. I use 2.3 dev (not nightly) and haven't tested in older versions.
  18. That's fun: foreach($templates as $template){ foreach($template->fieldgroup as $field){ if($field->name == "myfield"){ $template->fieldgroup->remove($field); $template->fieldgroup->save(); echo "deleted $field->name"; } } }
  19. When calling a page url without trailing slash.
  20. Dragan isnt the problem issued by a custom theme? It works in every browser for me.
  21. Moved to dev talk board.
  22. Ryan as mentioned in an other thread about urls it looks like if language page names is installed it doesnt redirect to trailing slashes as without module. Maybe related?
  23. And in modules there's also $this->pages ...
  24. Now that you say I also stumbled on the same odd behavior of built in fields versus custom fields the order matters
  25. I have it run!! I'm not sure I can follow you completely and I have a difficult time understanding what is wrong with your setup and how much you understand what you're doing. First, my setup is like this: We need a multiple select page field you can select from all page in your site tree, that is.. - pagelist_hidden - a page field, multiple page (page array) checked, the setting is "Home" page as the parent and the inputtype is PageListSelectMultiple* - No I attach this field to the user template (system template needs template filter set "Show system templates?" to show) So now I can select and add pages that should be hidden on every user page, since user template now has this field. Now if you login with the user, page are not shown in page tree anymore. This module does only this to filter those pages out on the ajax json response the admin page tree works with. It's more of a workaround and proof of concept / example module. It shows how it could be done. While this is simple, adding more features and configuration would go pretty complex and I'm not sure it's a route we should promote. Even just to reverse and add pages the user should see is a differnt thing considering a tree based structure. It's doable but maybe should be avoided. I your case it sounds like every time a new user is added you need to do a lot and add the new pages to each user. And you have templates for each user, but all the same setup? To get around the template based permissions I guess? I think it also could be avoided by using almost exact like module to add pages the user can edit and go with one set of templates. I think there's also some examples or even a module by Ryan around. https://github.com/ryancramerdesign/PageEditPerUser http://processwire.com/talk/topic/2141-module-page-edit-per-user/ http://processwire.com/talk/topic/3051-page-edit-per-user-and-template-access-how-do-they-relate/
×
×
  • Create New...