Language variable in html

Hi,

I’ve recently added a contact us page via the admin panel.



I would like to add the telephone number to this page, but I also have the telephone number on an about us page.



I’m not sure if i’m right in thinking this but can I just use a language variable and then put it in the html code on both pages?. That way I only have to modify the telephone number in the languages section to update all locations that have the number?



It seems logical but i’m new to CS Cart, and I have no idea how to insert language variables into html code.



thanks

Yes, that should work fine.

jbenitos, how did you solved this problem?

I’ll admit that I too don’t know exactly how to insert language variables into HTML. Can someone give a brief example?

When you’re editing a template, all the {$lang} variables are available.



So create a new Language Variable in Content > Languages. Call it “alt_phone_number” and enter the phone number in the text box to the right. Save the new variable.



In the template file, add {$lang.alt_phone_number} and voila, the telephone number appears.



Yay!

[quote name=‘gginorio’]When you’re editing a template, all the {$lang} variables are available.



So create a new Language Variable in Content > Languages. Call it “alt_phone_number” and enter the phone number in the text box to the right. Save the new variable.



In the template file, add {$lang.alt_phone_number} and voila, the telephone number appears.



Yay![/QUOTE]



Fair enough. But, you’re talking about editing templates. Is there a way to do this in regular content pages that would normally just be html code put in through the editor? For example, if I want language specific stuff to be part of a regular content page in some way, how do I do this as part of the regular HTML coding of the content for the page?



For example, if I put in {$lang.alt_phone_number} in the html code in the editor when creating a new content page, what I get is “{$lang.alt_phone_number}” showing on the page instead of the variable it’s calling. If I surround the call with then I get empty space and no variable.



Am I making sense?

In other words, I’m asking a different question than that asked by the OP. I want to be able to put language dependent content in regular web pages vie the html editor if possible rather than creating templates for any and all content pages.



Ultimately, what I want to do is to be able to create various pages with content on my website such that the content is handled via language variables instead of just putting the text straight in via HTML. I want to do this so as to make the content on the site square with whatever the language is that the user selects.



If there’s another way to do this then that’s fine but I could use some pointers if possible. Or am I just missing something very basic about how different languages are handled with CS-Cart?

So you want to create templates in the HTML editor … not possible at this time. The content in the editor would need to be run through the Smarty template engine to parse the variables.

Ah, got it. My understanding of how languages are handled was off. Thanks for the clarification.



By the way gginorio, you’ve been extremely helpful to me lately here on the forums. Mucho kudos to you amigo. :slight_smile:

I try.