Jump to content

add item middle of pagearray


lickny2001
 Share

Recommended Posts

i can't get this to work ... im trying to add an item in the center of my pagearray.

     // create new variable, shuffle array
     $imgShuffle = $folio->shuffle();

     // count array items, divide by two to get logo position on grid
     $count = $imgShuffle->count();

     // where to put the logo?
     $logoPosition = $imgShuffle->count() / 2;

     // round position
     $logoPositionRound = round($logoPosition);

     // target replaceimage
     $replaceImage = $imgShuffle->eq($logoPositionRound);

     // get replacing image (logo center)
     $logoCenter = $pages->get('/folio/amsterdam/')->child();

     // replace images
     $imgShuffle->replace($replaceImage, $logoCenter);

 

what am i missing?

thank you!

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...