html in translate variables

More
9 years 3 months ago - 9 years 3 months ago #56811 by John
html in translate variables was created by John
Hi Dam, I'm having some issues embedding html in the translate variables through the backend. It works fine for simple tags e.g. <h1>This is some text</h1>. But as soon as a I add a style it breaks. eg <h1 style="color:red;">This is some text</h1> doesn't work. I've tried replacing the double inverted commas with single and escaping them with backslashes and so on.

I can replace the variable directly in /components/com_osservicesbooking/classes/ajax.html.php with the html I want and this and this works ok. eg:

<?php echo '<p>Sorry, no appointments are available. <a href="/">Click here to contact us.</a></p>'; ?>

Ideally though I'd like to pop up a lightbox using nonumber models eg:
<?php echo '<p>Sorry, no appointments are available.{modal article=1}Click here to contact us{/modal}.</a></p>'; ?>

However the modal tags are not converted and the following is displayed:
Sorry, no appointments are available.{modal article=1}Click here to contact us{/modal}.

I can't figure out why it doesn't work as ajax.html.php is simply echoing the content and it should be converted.

So two questions:

1. Is there a way to enter complex html through the backend?
2. Any idea why tags entered directly into ajax.html.php aren't being converted when the page is rendered?

Thanks
John
Last edit: 9 years 3 months ago by John. Reason: Sorry, posted this in the wrong forum! I meant to put it in AS Services support.

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #56865 by John
Replied by John on topic html in translate variables
Hi, well I'm not really worried about question 1 anymore. I've found that the code in ajax.html.php is quite easy to understand and edit and lets me customise the product more specifically. Nice work...

Regarding the Q2, I see that the product is using a osmodal to implement the google maps lightbox. I expect I can call this to do what I need to do, though I haven't tested it yet.

Please Log in or Create an account to join the conversation.

Moderators: Mr. Dam