lickny2001 Posted January 13, 2018 Share Posted January 13, 2018 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 More sharing options...
Zeka Posted January 13, 2018 Share Posted January 13, 2018 HI @lickny2001 Try to use "insertAfter" method https://processwire.com/api/ref/wire-array/insert-after/ 6 Link to comment Share on other sites More sharing options...
lickny2001 Posted January 13, 2018 Author Share Posted January 13, 2018 like a charm, thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now