Internationalization Add-on - Put "Switch Language Block" into theme
Permalink Browser Info Environment
hi
I installed the Internationalization Add-on and everything works fine.
But I would like to add the "Switch Language Block" into my theme, similar to the autonav block you can directly write into your theme's template files.
Is this possible?
Thanks,
poetze
I installed the Internationalization Add-on and everything works fine.
But I would like to add the "Switch Language Block" into my theme, similar to the autonav block you can directly write into your theme's template files.
Is this possible?
Thanks,
poetze
Type: | Discussion |
---|---|
Status: | New |
Here's a good how-to on hard coding blocks into page types:
http://www.concrete5.org/documentation/how-tos/developers/hardcode-...
You could put something like this in your page type:
But you'd also need to call the block's javascript, maybe in the header.
http://www.concrete5.org/documentation/how-tos/developers/hardcode-...
You could put something like this in your page type:
<?php $switchBT = BlockType::getByHandle('switch_language'); $switchBT->render('view'); ?>
But you'd also need to call the block's javascript, maybe in the header.
thanks for the help.
I got the block into my template, but it didn't seem to work right, so I tried the other solution from the "How to hardcode.." tutorial: to insert a line of code that embeds a block you created and saved in your scrapbook.
That worked fine.
I got the block into my template, but it didn't seem to work right, so I tried the other solution from the "How to hardcode.." tutorial: to insert a line of code that embeds a block you created and saved in your scrapbook.
That worked fine.
indeed, and for those whoo want to inclide the flags display, choose the appropriate template :
<?php $switchBT = BlockType::getByHandle('switch_language'); $switchBT->render('templates/flags/view'); ?>
Thanks for adding that. We've had a few folks ask how to add the flags (which are usually enabled by selecting the custom template) but it's good to have an example of how to hard-code them as well.
http://www.concrete5.org/index.php?cID=11798...
In your case the block's name is 'switch_language' and anything that is mentioned in those calls to $bt->controller is going to be located in packages/blocks/controller.php
If you run up against anything just post back to the thread.
edit: Changed "would" to "should" up there since I haven't personally tested this.