Jump to content

Sanyaissues

Members
  • Posts

    62
  • Joined

  • Last visited

Posts posted by Sanyaissues

  1. Leaving this update here, for the future:
     

    Quote

    In addition, the WireHttp class was updated with new delete(), patch() and put() methods which correspond to http methods of the same name, These might be used by web services in addition to the more common GET and POST methods. In prior versions of WireHttp, you could still use delete, patch and put methods, but had to use WireHttp::send() with the $method argument set to one of them.

     

    • Like 3
  2. Nice! I love it. Today, while working with JSON stored in Page fields, I received the newsletter containing a link to your module. I instantly felt that it was perfect for replacing my json_decode calls.

    Just out of curiosity, what do you typically do when you need to retrieve a value, modify it and save the value again in the field? I was doing:

    $page->of(false);
    $json = json_decode($page->jsonfield, false);
    $merge = array_merge($json, $otherJson); //$otherJson is a json I want to push to the field
    $json = json_encode($merge);
    $page>save();

    I'm trying to understand how to  get the field with the textFormatter in that situation, because if I call page->of(false) before retrieving the value, obviously the value came as a string, but If I set page->of(false) after retrieving the value, the value is not saved. 

    $json = $page->jsonfield;
    $page->of(false);
    $merge = array_merge($json, $otherJson); //$otherJson is a json I want to push to the field
    $json = json_encode($merge);
    $page>save(); //Isn't saving

     

  3. Thanks all for the compliments!

    @horst Actually, I didn't add any values for defaultGamma, sharpenning, etc... I just set the quality to 90 in the $config->webpOptions.

    $config->imageSizerOptions('webpAdd', true);
    $config->useWebP = true;
    
    $config->webpOptions = array(
        'quality' => 90, 
        'useSrcExt' => false, 
        'useSrcUrlOnSize' => true, 
        'useSrcUrlOnFail' => true
    );

    Thanks for the tip to protect the original images.

     

    • Like 1
  4. Edit: Forget it. The error disappear.

    Hi Does anybody understand why this error? SeoMaestro 0.8.0 / PW 3.0.135

    Fatal error: Method SeoMaestro\PageFieldValue::__toString() must not throw an exception, caught ErrorException: chdir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/vhosts/xxxxxx.com/:/tmp/) in /var/www/vhosts/grupopages.com/sites/xxxxxxx.com/wire/core/WireDebugInfo.php on line 0

  5. Hi, I have a page with a repeater called teams with two fields: team (a pageReference with a list of teams) and people (a pageReference with a list of people who likes this team).

    I'm trying to populate the people field in the repeater according to the value of the team field in the same repeater. So far. I'm able to get the pageArray that I want to assign to the people field, but i don't know how to "save" the value for each instance of the repeater.

    I hope somebody can give me a light. Thanks in advance.

     

    $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) {
      if($event->object->hasField == 'people') { 
        $repeaterField = $event->arguments('page')->teams; 
        foreach ($repeaterField as $t) { // Is this the way to loop the instances of the repeater?
          $team = $t->team->id;
          $t->people = $event->pages->find("template=user, team={$team}");
          var_dump($t->people); // This returns the values that i want to assign for each repeate instance
          $event->return = $t->people; // I hope this assign a custom pageArray for each repeater, but it assigns the same for all the instances of the repeater
        }
      }
    });

     

  6. Update: The render behavior of the profile is correct. My mistake was to use TextLanguage in the fields  when i just need the user to see labels according of his language (that can be achieved with the text field type).

    Hi,

    I'm using LoginRegister to allow users to edit their users profiles in the front-end, and some of the user fields are type TextLanguage (to allow multiple languages).
    The problem is that when I render the Profile Edit, the inputfields shows in all the installed languages. That doesn't happen when I render the login or register forms.

    How can i prevent that the TextLanguage inputfields render in both languages?

    My code

    <?php
      $user->language = $languages->get("default");
      $input->get->profile = 1;
      $profileForm = $modules->get('LoginRegister')->set('renderStyles', false)->execute();
    ?>
    and later...
    <?= $profileForm ?>

    The output for an multilanguage inputfield:

    <div class="InputfieldContent ">
      <div class="LanguageSupport" id="langTab_Inputfield_profile_firstname" data-language="1029">
        <label for="Inputfield_profile_firstname" class="LanguageSupportLabel detail">English</label>
        <input id="Inputfield_profile_firstname" class="InputfieldMaxWidth" name="profile_firstname" type="text" maxlength="2048">
      </div>
      <div class="LanguageSupport" id="langTab_Inputfield_profile_firstname__1031" data-language="1031">
        <label for="Inputfield_profile_firstname__1031" class="LanguageSupportLabel detail">Spanish</label>
        <input id="Inputfield_profile_firstname__1031" class="InputfieldMaxWidth" name="profile_firstname__1031" type="text" maxlength="2048">
      </div>
    </div>

     

  7. After enable the Tags File Compiler module, echoing variables with brackets syntax doesn't work. I try something simple like {page.title} and is displayed like the tag isn't parsed:

    {page.title}

    This problem happens with PW 3.0.108, i have another installation with 3.0.82 and it works. Any Ideas? thanks.

  8. New website for the Camel cigarette brand. When you enter you will see an legal smoking age alert in Spanish, please click on the lower right option "Soy mayor de edad, me registraré luego" (Legal age confirmation)

    https://camel.com.do

    Modules used:

    • ProCache
    • Croppable Image 3
    • Form Builder
    • Login for Facebook
    • ProDrafts
    • Profiler Pro
    • ProcessWire API Explorer
    • Tracy Debugger
    • ListerPro
    • Redirects

    cmel.jpg

    • Like 9
  9. On 4/20/2017 at 11:10 PM, MilenKo said:

    @Sanyaissues I know its been a while since you posted the page in this topic but it really gave me an idea to try - the ingredients list. Could you share some ideas of the approach? The only way I can see it through is by using the repeater approach for every ingredient in the recipe but it has its downsides...

    All the ingredients are pages and they are linked to the recipes with repeaters. Each repeater has an ingredient and a description: Butter / 1 cup  butter. 

    Did you try another approach?

×
×
  • Create New...