Jump to content

Ivan Gretsky

Members
  • Posts

    1,412
  • Joined

  • Last visited

  • Days Won

    15

Community Answers

  1. Ivan Gretsky's post in How to update a language pack? was marked as the answer   
    I think that you are right and there is no other way (at least that I know of). Some changes to working  translations were introduced recently, so you have the option to only upload one csv file instead of many jsons. But I do not know of a language pack having such a csv yet .
  2. Ivan Gretsky's post in Why is $pages undefined? was marked as the answer   
    This is because of a variable scope. Use wire('pages')->find(...)... instead. See Ryan's explanation here.
  3. Ivan Gretsky's post in How to keep a field populated for a specific time? was marked as the answer   
    Hallo Neo! Follow the white rabbit.
    1) Pages scale much better that repeaters. So if you will have really lot of banners you better use pages. Or consider commercial Repeater Matrix field.
    2) You do not have to unpublish your banners. You can just add a datetime field and name it something like show_until. Then in the code just use this field in the selector and choose only pages that have show_until field value less than today.
    3) If you really need to unpublish those pages you can use Lazy Cron module.
  4. Ivan Gretsky's post in Creating custom template user using API was marked as the answer   
    ...ok just do it as with a regular Page
    $u = new User(); $u->template = "custom-user-template"; $u->parent = "custom-user-parent"; $u->save(); Sometimes you need to spoil your forum karma to get your head working as it should)
  5. Ivan Gretsky's post in Please update your $config->httpHosts after session timeout ? was marked as the answer   
    Do you have exactly the same string in $config->httpHosts and in your vhost configuration?
    ...and you can alway just leave $config->httpHosts empty to allow anything.
  6. Ivan Gretsky's post in Create New page not showing all templates was marked as the answer   
    Did you change allowed parents/children options on the family tab for your templates?
  7. Ivan Gretsky's post in smart hook on field save was marked as the answer   
    If you only want to prevent saving the current field, you probably could modify the code above to be hooked before FieldtypeMulti::savePageField and add something like this in the end:
    if($page->your-field == "now-value" && $pageBeforeChange->your-field == "before-value") { $event->replace = true; } This should replace the whole FieldtypeMulti::savePageField and prevent the field from being saved. Not tested. No guarantees .
  8. Ivan Gretsky's post in apply fancybox only to one template was marked as the answer   
    It seems like you are trying to use "delayed output" aproach as you are extending on a standart site-languages profile. You have to put all the html generated in gallery template in a $content variable for it to be rendered in the _main.php.
    Like this:
    foreach($page->images as $image) { $thumbnail = $image->size(150,100); $content .= "<a class='gallery' rel='gallery-1' href='{$image->url}' title ='{$thumbnail->description}'><img src='{$thumbnail->url}' style=' padding: 5px;' ></a>"; }
  9. Ivan Gretsky's post in Exceeds max allowed file size error on live server was marked as the answer   
    1) I found the problem and the solution. Processwire cannot read post_max_size if it is defined in bytes (see here). It sets it to 5M in that case instead. Define your php_ini variables as 100g, 50m, 1200k, but not as 104857600.
    2) And I have not been able to redefine the value due to little typo: it had to be $f->maxFilesize instead of $f->maxFileSize.
  10. Ivan Gretsky's post in Contact Form creating 403 error. was marked as the answer   
    ...or create a template "engine", so engine.php will be your template file.
  11. Ivan Gretsky's post in Frontend Translations was marked as the answer   
    Go to Setup->Languages.
    Choose a language for which you will create transaltions (by default there is only one language called default, crete more if you need them).
    Under "Site translation files" press "Translate file" button.
    Choose a file to make translation to and "Submit".
    Go ahead and express your super multilingual capabilities.
  12. Ivan Gretsky's post in How to show pages in a different language than default? The Url segment? was marked as the answer   
    As multilangual support is not on by default, you have to turn it on by yourself: http://processwire.com/api/multi-language-support/multi-language-urls/.
    Probably the 1st time you installed PW with multilangual profile, where corresponding module is preinstalled.
  13. Ivan Gretsky's post in Make assets from different pages accessible from a single URL was marked as the answer   
    I found this topic. Looks related and Ryan answers...
    I thought there was a module to manage assets the way you described, but could not find it. Maybe I was just dreaming)
×
×
  • Create New...