Multi-language store- Changing custom menu's language dynamically - magento

I am doing Multi-language store in magento. i have some custom menu in header section like how to order, Help etc. .
now currently these menu i have given direct link like
<li>Help</li>
<li>how to order</li>
i am not sure how multi-language feature will work with this menu.. How can i write these top menu as if It will change with language change.
any suggestions will be helpful for me.
thanks

Any text that is hard-coded into your template needs to be wrapped in the translation helper.
echo $this->__('Help');
But make sure the block it applies to has a helper declared, otherwise you'll need to load the generic helper.
Mage::helper('core')->__('Help')
Then, you can edit the relevant translation CSV file. By putting "Help" in the first column, and the translation in the second column.
Although, you'll be able to use translate in-line once you are using the above PHP.

Related

Joomla 3 Overwrite/Change "Menu Manager: Edit Menu Item"

Like the topic say I want to overwrite/change the "Menu Manager: Edit Menu item" layout. To illustrate my question:
In the picture whiche is shown I want to change the labels: Layout, Option, Integration.... and add some other options to it. How can I do it? Or is this even possible?
In order to change the text, simply use language overrides, google is your friend.
In order to add functionality, let's first of all explain what we're talking about to ensure we're on the same page.
Joomla components have views which can have one or more layouts, i.e.
/components/com_content/views/category/tmpl/ contains two layouts, blog and default.
A layout can additionally contain an .xml manifest (in our case, blog.xml and default.xml) allowing us to create a menu item for the specific view/layout combination. The .xml file contains the parameters that the user will set, you can add your own as well.
When you want to change Joomla, usually there is a way to do so without touching the core, which would be pretty bad, as any Joomla! updates would break your work.
For the view layouts a special feature called template override was developed, which allows you to create an alternative to the view layout in a safe place (under your template folder, in this case your admin template), and this is the most elegant and effective way to achieve your result.
Beware though, you are just creating a layout, most likely you will want to add functionality, if it's complex you might be better off creating a dedicated component to keep the code clean. Or you can just put all the logic in your view, query the database from there. But in this latter case, get paid, and run away. Never answer the phone to the customer again.
A final alternative is to write a system plugin that will manipulate the page markup after it was generated in the event onAfterRender(). This is a simple and good approach if you only want to add a button or make minor changes, but if you do anything more than that, see the above advise about running away.

Is it possible to change text directly in the code

I would like to know if there is a way to change text in the code instead of using the admin panel? I have Filezilla installed and can access my site/files from there.
If I use the inspect element in any browser, I can see an HTML structure, but as I have understood there is no HTML document in Magento, right? So where do I go if I want to make a change to a text element on my site and I don't want to use the admin panel?
Most of the text elements are handled by Magento's language translation system.
Quite often, you don't have to mess around hacking templates, just simply add a line to the translation CSV with the text string exactly as it appears, add a comma and then the new text string you want Magento to display.
For example, if you're working with US English, you can use the following file in your own custom template package as follows:
app/design/frontend/default/your_package/locale/en_US/translate.csv
Let's for example, change one of the window shade bar titles in the One Page Shopping Cart. Add a line to translate.csv as follows:
"Billing Information","Billing Address Information"
How this works, in the template the following line normally displays the title:
<?php echo $this->__('Billing Address') ?>
This code snippet $this->__('Billing Address') is a call to Magento's language translation system. It reads the translate.csv file finds Billing Address and changes it to Billing Address Information when it assembles the page html.
Lotta people out there have made changing text like this far harder than it has to be.
Hunting down the proper template, changing the text, finding the template got messed up, or trying to remember after the fact what was changed.
VS.
Changing a simple central file that contains all the text string translations... Often only by adding a new line to the file
Magento actually makes this very simple.
Thank you! So magento stores all text in .csv? or just the stuff that needs to be translated? I'm making a search for .csv via Filezilla but I only get two languages (the site is translated to multiple languages). Should I be looking somewhere else?

Joomla mulitple layouts in a single template?

Respected Specialists,
Is it possilble to create mulitple layouts inside a single joomla template ?. So that for each menu we can choose different layouts from the same template ?
Yours faithfully
Murulimadhav
Yes you can. You can code it by hand yourself if you want to, or look at using a library like Gantry to do the job.
Gantry is reasonably easy - as it gives you some default templates to start with. You can then customize them, and nominate which positions within the template actually display.
The easiest way would be to make multiple copies of your template, modify them and assign them to the various menus. To duplicate a template follow the steps described in the following:
Joomla2.5
Joomla3.2

create dynamic template for joomla 1.5

there are tutorials on the web about gow to create index.html, css file and template.xml that contain placeholders. ok, i got it, it's simple. but i need a template that has some different views. for example:
-all pages have a topmenu, header, left sidebar, mainarea and a footer but:
-first page has no header .topmenu after which sidebar, mainarea and footer comes.
-second page has sidebar moved from left to right
-third page has four blocks (blocks for special offers) instead of mainarea.
as far as i can see, i need to create three standalone templates with unique set of placeholders for each template. because i can't see the way to change laarge mainarea placeholder with four placeholders for offers blocks on some pages. dynamically.
is there if-statements in joomla templates to simply determine a document id to view four placeholders instead of mainarea. or to not show header on the main page (f.e. doc. id="mainpage")
but i want it to be selectable like:
-this page has first case of that template (index_1.php)
-and that page has a second case of the same template (index_2.php)
like a selectbox.
is that possible?
I will make this an answer as opposed to a comment since I believe it will do what you are looking for.
Once your articles are setup and your links to them are established (the site has the info on it you're looking for), you can create the modules containing the data that you want shown from time to time.
Go to the module manager - on the right you should see 'module assignment' or something along the lines of 'display this module on the following pages'; you can then pick which pages you want the module to show on. You can specify all pages, none, specific pages, however you want.
This will enable you to show them only where needed however you like.
You can ALSO do this programatically inside the module (if you do custom HTML and use an extension like Sourcerer to add PHP to the module) with PHP should you want a little more flexibility, but just choosing the pages to show on should work for what you're doing.

Joomla 1.0 - need to add drop down menu into existing template

What is the best and easiest way to add a drop down menu to an existing template in Joomla 1.0 (can't upgrade it)?
Thanks
Module SwFreeMenu works with 1.0 afaik.
Depends on what sort of options do you with to provide in that menu. If it's just some static stuff, like Select language: (options) English, German, Spanish, you might get away with adding that directly to the template by editing the template's HTML markup in the right place.
However, if you intend to do something more dynamic, than template is not the place to hack. You may want to create a "module" and ten add it to your list of site modules, to a desired position defined by the template. Then you can set which pages is this module going to appear on. I believe you can duplicate a simple module like the search box, and then change the module's code. I haven't done it before but I bet it's pretty simple.

Resources