jds43 Posted December 6, 2021 Share Posted December 6, 2021 Hello, I have a multi-lang template (English and Spanish) where title, summary and body are translated. This template has many children in default (English) language and I need to output fields from these as cards on the Spanish page. Is this even possible? Link to comment Share on other sites More sharing options...
jds43 Posted December 6, 2021 Author Share Posted December 6, 2021 I see that activating languages for this child template works for populating the cards, but I'll be deleting and re-importing a sizable list every few weeks and will need a way to activate the Spanish name for all. Should I not use the Import Pages by CSV module and opt for another solution? Link to comment Share on other sites More sharing options...
jds43 Posted December 7, 2021 Author Share Posted December 7, 2021 This will activate Spanish by template: if($page->activate_spanish == 1) { $imported_producers = wire('pages')->find('template=producer'); foreach ($imported_producers as $p) { foreach (wire('languages') as $lang) { if ($lang->isDefault()) continue; $p->of(false); $p->set("status{$lang->id}", 1); $p->save(); } } } 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