Forum
Language conditional inside blog's post template
Hi, I am running a multilingual blog and I would like to avoid making separated posts for each lang. I'd rather prefer to have one post template and have those options together and then make some kind of conditional to filter using $lang variable. Any idea? — Thanks!
<h2><perch:blog id="postTitle-es" type="text" label="Title (spanish)" required="true" /></h2>
<h2><perch:blog id="postTitle-en" type="text" label="Title (english)" required="true" /></h2>
<h2><perch:blog id="postTitle-fr" type="text" label="Title (french)" required="true" /></h2>
Yes, that should work fine. What problem are you hitting?
I don't know how to show only current $lang content Drew. Thanks for fast reply
It appears empty after saving blog post...
Are you passing
lang
into the template?I put this on post.php
Should I add something like this?
Yes, looks just right. What's happening?
Yes it works, should I take out 'My region'?
Yes, that part isn't correct.
Thats better?
Yes - is something not working?
It works, thanks Drew!