Admin
Purple Wires
Purple Wires: Conditional imports
8min
purple hub summary purple wires allows conditional imports, learn how to import data based on conditions with this article from taxonomy import and conversion to fetching generic meta data, learn how to define allocations and conditions for meta fields preconditions have an admin role in purple hub for being able to configure purple wires find here an overview of roles & rights in purple hub docid\ djj5yjjacdplm9qt0qlfk description import based on conditions if not using the 'mapping configurator' you can define your own configuration by the following rules taxonomy import taxonomy split up taxonomyitem\ convert\[ split] where taxonomy can be 'category', 'tag' or any qualified own taxonomy slug split example categoryitem\ convert / on fetched data "germany/news/economy" will return the three categories 'germany', 'news' and 'economy' mytaxitem\ convert on fetched data "germany news economy" will return the three elements 'germany', 'news' and 'economy' for own taxonomy 'my tax' (with the slug 'mytax') taxonomy conversion taxonomy conversion taxonomyitem\ match\ allocation\ condition taxonomyitem\ match\ allocation\ condition where taxonomy can be 'category', 'tag' or any qualified own taxonomy slug argument argument match defines that the allocation string will be set by defined condition rule this will happen after an optional conversion (as described before) example example categoryitem\ match\ germany\ deutschland categoryitem\ match\ germany\ deutschland on fetched data "germany" will return the category 'deutschland' categoryitem\ convert / categoryitem\ convert / and categoryitem\ match\ germany\ deutschland on fetched data "germany/news/economy" will result in return of the three categories 'deutschland', 'news' and 'economy' meta import generic meta fetching metaitem\ fieldname\[ format\[ split]] argument fieldname is the name of the meta field argument format (optional) can be r (repeater) if 'repeater' is choosen as format, the first param needs to be defined in acf fieldname syntax, e g repeater%item , where first value ( repeater ) describes the repeaters name and second value ( item ) describes the repeaters subfield the third parameter split will be the char to split up the given string if param is empty, data will be split by blank spaces allocations & conditions metaitem\ fieldname\ allocation within meta storage you can define allocations where allocation will be set, if xml element value is not empty reserved single chars are 's', 'a' and 't' metaitem\ fieldname\ allocation ==string if the xml element value is equal to string, the allocation will be done metaitem\ fieldname\ allocation !=string if the xml element value isn't equal to string, the allocation will be done metaitem\ fieldname\ allocation %=string if the xml element value contains string, the allocation will be done metaitem\ fieldname\ allocation %!string if the xml element value doesn't contain string, the allocation will be done 'equality conditions' are case sensitive, 'containing conditions' are not case sensitive