I am happy to announce the release of Localizer add-on for Pulse 4. With Localizer, you are able to create true multi-language sites without the need of duplicating the whole website.
Localizer is easy to use and works exactly like the block tag.
This is so great, this was on my wishlist for so long and now here it is, and with so little code, unbelievable clever.
What I dit was set the default language in the nav like so: href="?locale=nl"
on line 5 in local-init.php
$locale = ānlā;
and on line 28 like so
if (strlen($locale) == 0) {
$locale = ānlā;
}
Now I have only one hurdle to go, the menuās have to be in the blocks too, and I happen to have highlight current menu-items based on php, in the blocks the php is stripped out, so now I have to change that to a nice jsā¦
@boisdejardin, I have pulse3 in most of my projects, (plan to leave pulse3 as soon as pulse5 is out,) could you tell me info where to find info about those superblocksā¦? Was searching but couldnāt find itā¦
Iām sure that this is also a feature in Pulse version 3 but I could not find the version 3 documentation on the Pulse website to verify it. So I have tried it myself before writing this answer.
The following text is a modified version of the Pulse 4 Blocks documentation :
Super blocks are like regular blocks with two differences. First the WYSIWYG editor is replaced by a plain text editor. This editor will not adapt the content of your file while saving. Second, you can have code such as PHP and JS in the block. To create a Super Block, just create a new block and prefix the name with āsb_ā, for example āsb_dateā.
Use for instance as content : <?php echo date("l jS of F Y h:i:s A"); ?>
Integrate this Block as normal on a page with its full name (sb_date.html)
What about that then⦠Might have understood that wrong, I did a test with a nav-menu with php-highlight-current-page in a SuperBlock and now also that translates along with the rest, hooray! You made my day!
The Pulse WYSIWYG editor is clever, I do find it to clever sometimes.
Positive : It tries to repair incomplete HTML tags like adding a missing P-tag.
Negative : It will replace HTML character codes with their result values. For instance the HTML code for euro will be replaced by the euro sign and the Non-Breaking-Space becomes useless because it will be replaced with the standard space character. PHP code will be converted into HTML comments.
My advise : Use Super_Blocks for everything where you need a bit of code in your text !
No thanks a lot! I certainly will use SB more, I had heard of it, or read somewhere about it here ,but I didnāt know it was that easy.
About the wysiwyg editor, I always have to place a fake classname in a span tag because otherwise it is stripped out.
Non breaking space, you mean, nbsp?
Yes, I meant in my opinion a very usefull HTML character code.
I know that somehow you can modify the features of Redaktor, the Pulse WYSIWYG editor, but to me it did not look very straightforward. Besides that, the modifications will be gone after a Pulse update.
@boisdejardin, very usefull, € so that it all stays nicely together and who knows, the makers of redactor modifies it and it comes along with an updateā¦