you got it textdriven, it will always use your default language unless another is available. for embeds though I’d still recommend the conditional approach as I mentioned above. I’ll continue to look into the switch though.
It’s only because I’m running sites with 8 languages that I thought switching the name of the template it embeds would be useful. I’ll try it the other way otherwise. Thanks.
Since global variables work now, you could use them to hold the embedded template name.
The global variable would contain its own name as the variable.
<strike>If it works i would absolutely recommend going that way. I think the way the EE conditionals work; if you have two embeds in an if then an else, it will parse both embeds before running the conditional, not very elegant but that’s the way it is. That means if your conditional is 10 embeds long you’ll parse 10 pages for each page view. (Can someone confirm this? Check your SQL log on a page using conditionals to embed pages and you’ll see queries from the pages that aren’t being called). If it is the case using a variable in the embed should remedy this.</strike>
Ok, I jumped the gun. I just tested out my theory above and in fact the embeds are run after the conditional, so it really shouldn’t matter which way you go.
it looks great. is there a reason though that there’s so much redirecting? it pushes me back to the ‘site/newsletter’ page before sending me back again to the ‘resources/newsletters’ page i was on.
Strange, because if you’re on the resources/newsletters page the extension should just link you to resources/newsletters/lang/_suffix_ and then back to resources/newsletters. Is this not how it behaved?
Ok, I think I see now. Glad to know it’s not the extension pushing all those reloads. Basically I see your redirecting the lang/suffix to site/news_detail with is then redirecting to resources/newsletters. I can’t really say if that’s a good thing, but it does appear to be working so I’d go with it. Really I just wanted to be sure that it wasn’t the extension messing up.
Hi Mark - fantastic extension! I was wondering if there’s an easy way to get this extension to switch category custom fields (for example switch the default cat_name to a new custom field called cat_name_fr).
This would take advantage of the new 1.6 features and would save me from maintaining identical category group structures.