Jump to content

Pauline

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by Pauline

  1. Hi FreeAgent,

    If I get you right, then you have a page with name "blog" under the homepage. If the current page is a child of "blog", you want to display the shares, right?

    if ($page->rootParent->name == "blog") {
        echo "social share stuff";
    }
    
    // if this doesn't work, you can try additionally
    if ($page->rootParent->name == "blog" && $page->name != "blog") {
        echo "social share stuff";
    }
    

    PS: the editor button with this sign: <> opens a box for code.

    • Like 2
  2. I have very bad experiences with 1 & 1.

    I would go here: http://all-inkl.com/ you will pay 1 € more per month but you also have 5x more space, 5 mysql DBs, 3 domain names, etc. Also they have a very friendly and helpful phone and email support. (Phone to a normal local number, not to a high charged number for 1,90 per minute like 1&1)

    But in general the 1 & 1 tarif should allow a processwire installation, but only one! (Whereas at all-inkl.com you can install 5 in parrallel in 3 domains and / or subdomains)

  3. Hey Martin,

    basicaly you need to check for portrait or landscape oriented image first:

    $options = array('cropping'=>true, 'upscaling'=>false);  // cropping => true is default and same like 'center'
    
    foreach($page->images as $img) {
        if($img->width > $img->height) {              // check for orientation
            $thumb = $img->size(200, 100, $options);  // we have a landscape oriented image
        } else {
            $thumb = $img->height(100, $options);     // we have a portrait oriented image
        }
        // output your markup here
        echo "<img src='{$thumb->url}' alt='{$thumb->description}' />";
    }
    

    In your special case you need to check for landscape oriented images that have a width more than two times the height:

        if($img->width > (2 * $img->height)) {        // check for images with more than two times the width compared to the height
            $thumb = $img->size(200, 100, $options);  // we have a landscape oriented image
        } else {
            $thumb = $img->height(100, $options);     // we have a portrait oriented image
        }
    
    
    • Like 1
    • Thanks 1
  4. Well, my five-year-old daughter knows about ProcesWire already, or at least the amazing community we have here. She regularly enters my office, sees me on the PW forum, and asks to see that "green monster" that shows up on the forum pretty regularly.

    Haha :) Similar experience from here: my six year old son recently asked his mom "did you know that dad has a friend called Ryan, who lives in USA?"

    Hello, I want to tell the other children something: The "Green Monster" is really just a young man!

    I am 8 years old and also know ProcessWire. :)

    My father writes a lot on ProcessWire. :)

    • Like 6
×
×
  • Create New...