EssickAir Posted June 28, 2022 Share Posted June 28, 2022 So I'm trying to use setName as a way to change the name of about 1000 child pages because I need it to be different. I wrote the code an it works because it is changing the URL but not the "name" of the page. What am I doing wrong? <?php foreach($page->children() as $child){ $sku = str_replace(' ', '-', strtolower($child->upc)); $page->setName($sku); } ?> What am I doing wrong? the UPC changes. but the page name does not. Thanks Link to comment Share on other sites More sharing options...
bernhard Posted June 28, 2022 Share Posted June 28, 2022 Do you save the page after changing its name? Link to comment Share on other sites More sharing options...
EssickAir Posted June 28, 2022 Author Share Posted June 28, 2022 15 minutes ago, bernhard said: Do you save the page after changing its name? OMG you're a genius. I don't know how I missed that, but thanks. I just needed to run $child->save(); thanks 1 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