Jump to content

incognito.ms

Members
  • Posts

    40
  • Joined

Posts posted by incognito.ms

  1. The FAQ has this information:

    Quote

    Can I implement sidebar layouts with RockPageBuilder?
    Yes! You can create as many RPB fields as you like. For example, one for the normal page content and one where you can provide different elements for the sidebar (e.g. calendar, become a member, news, etc).

    So it seems to be possible to add two or more RockPageBuilder fields to the same template. But how do I place them in the template file?

    <?= $rockpagebuilder->render(true); ?> does not reflect a certain field.

  2. 22 minutes ago, Vigilante said:

    Simple question. When I have a pagearray object and use methods like import, prepend, append, push, does PW automatically avoid duplicates? Or is it possible for a pagearray to hold multiple references to the same page?

    I'm mainly concerned about import because I'm importing a multi-page reference field and don't want duplicate references if a page already exists in the pagearray.

    Based on early tests/uses, it doesn't appear to have duplicate references, but I want the official answer about it.

    import() skips over any items already present in the WireArray: https://processwire.com/api/ref/wire-array/import/

    22 minutes ago, Vigilante said:

    And while on the subject, is there a difference between append and push? Both are described as adding a page to the end of the array, so not sure.

    Push is an alias for append: https://processwire.com/api/ref/wire-array/push/

    • Like 3
  3. Hi @Gideon So 

    basically you have to switch the user's language like this:

    $user->language = $languages->get('en');
    $page->setAndSave('title', 'My title');
    
    $user->language = $languages->get('de');
    $page->setAndSave('title', 'Mein Titel');

    Alternatively, you can use the setLanguageValue() function:

    $page->of(false);
    $page->title->setLanguageValue($languages->get('en'), 'My title');
    $page->title->setLanguageValue($languages->get('de'), 'Mein Titel');
    $page->save();

    See docs here

    • Like 4
  4. I think it's a matter of personal taste... Alternative syntax would be something like this:

    <?php
    
    $imgoptions = [
        'quality'   => 100,
        'upscaling' => false,
    ];
    
    $products = $page->siblings("id!=$page");
    
    ?>
    
    <?php foreach ($products as $prod): ?>
    <div class='uk-width-1-2@s'>
        <?php if (count($prod->images)): ?>
        <a href="<?= $prod->url; ?>">
        [... and so on ...]
        </a>
        <?php endif;?>
    </div>
    <div class='uk-width-1-2@s'>
        <?= $prod->title; ?>
    </div>
    <?php endforeach;?>

    Furthermore, I normally separate the controller logic (upper part between <?php ... ?> from the view part (lower part) in different two files. In this case, the controller part is very simple, though.

    • Like 2
  5. 3 hours ago, Markus Thomas said:

    Nice work, but one question, why not multi-language?

    Why do you assume it isn't capable of different languages? The source code contains pretty much translatable strings like that:  _('You have logged out') – the underscore indicates that it is translatable. What's missing now is the translation itself – feel free to chime in! Here is all you need :)

    • Like 3
  6. I love this module!

    Maybe it's just me and my weird server, but installing it on ProcessWire 3.0.61 (fresh install) throws the following notices though:

    Notice: Undefined index: showDebugBar in /var/www/site/assets/cache/FileCompiler/site/modules/TracyDebugger/TracyDebugger.module on line 544

    Warning: in_array() expects parameter 2 to be array, null given in /var/www/site/assets/cache/FileCompiler/site/modules/TracyDebugger/TracyDebugger.module on line 544

    They vanish if the modules configuration is saved for the first time.

    • Like 2
×
×
  • Create New...