mrkhan Posted July 12, 2016 Posted July 12, 2016 Hi, I have one xml FEED and I want to create pages for each item in XML via API. First time i am trying to create page with API, every thing is working fine but the issue is 1. its creating duplicate pages every time i run that XML. i have one unique field in XML called item_id & i want to create page with item_id as page name, i want to check that if page exist with item_id name before creating page. how can i do that ? Thanks
adrian Posted July 12, 2016 Posted July 12, 2016 if(!$pages->get("name={$item_id}")->id) { // create new page } Although you probably want to add other limiters to the selector, like a parent page or template. 2
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