Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

How to...

How to...

Hi,

I need help, please. Just purchased Metamod Pro wich is a great stuff!

Now, I need some more functions.
Example: I have a page with a list of products. These products offers different languages (English, Italian, French etc...).
I want to display a little flag near every product based on location of the user (IP detection).
I'm currently using Metamod Pro with function {loadposition} but this is a bad work... too many loadpositions!

Is Metatemplate pro my solution?
How can I do that?

Please, help!

dfiocch
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: How to...

Hi dfiocch,

can you describe a bit more about what you want to achieve? Do the flags have to match up with the languages of the products in some way, or are you basically wanting to get the flag of the country of the user, and insert this into some part of every page?

What are you using for the product pages - is this VirtueMart, standard Content pages, or some other shopping cart or CCK extension?

If it's an extension that uses standard Joomla component overrides, then you might be better off to do a component override and put some logic into the modified template for that content type.

If the flags have to go into a different place in each article/item, then you're still going to have to put some kind of placeholder in every item. You'll be better off to standardise where the flags whould appear, e.g. before/after the item. Then it's probably going to be easier to find a way of inserting the flags into that position.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Re: How to...

Hi Stephen,

thank you for your reply.

I want the flags match up the language of the user, near product listed (something like this: product_name[flag]). For example, if user is Italian and the product supports Italian language, flag must show near product.
I use standard Content pages (tables with lists of products).

How can I do that?

Thanks!

dfiocch
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: How to...

Is it 1 product per article? Or does 1 article have a table with a whole lot of different items in it, each article with its own list of possible languages?

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Re: How to...

Each article has a list of products.
1 article has a table with  different items in it, each article with a list of products with different languages.

Example:

Product1 [French]
Product2 [Italian]
Product3 [Italian]
Product4 [English]
Product5 [Italian]

and so on...

Sorry... sad

dfiocch
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: How to...

Hmmm. One way to do this would be to do a sort of targeted search-and-replace on the page. If the only place where you see the string "[Italian]" is on these particular pages, then I could imagine a system whereby if the guest is from Italy, then you do a search-and-replace to add the Italian flag after that text. And you'd do the same for the other languages.

At the moment Chameleon doesn't offer a search-and-replace "action", but it's on my list of new developments. Leave this with me; I'll see what I can put together as a new plugin.

One last thing: should this be based on the GeoIP country of origin, or based on browser language, or based on site/JoomFish language? Can you assume that everyone from France wants the French language version? What about people from Netherlands or Switzerland with multiple languages?

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Re: How to...

Hi Stephen,

Yeah! That would be great!
Exactly!

This should be based on GeoIP country of origin.

Actually, I'm doing that: I've created some modules with only a flag. One flag per module.
Then, created custom Metamods with GeoIP activated and assigned at one each flag module and in different positions (ex: flagit, flagfr, flagde...).

Then, the list is my backend:

Product1 {loadposition flagit}{loadposition flagde}
Product2 {loadposition flagit}
Product3 {loadposition flagen}
Product4 {loadposition flagit}{loadposition flagen}
Product5 {loadposition flagit}{loadposition flagen}{loadposition flagde}

In fronted users will see only the flag with their language.
Little trick...

Sorry for my bad english!

Thank you and let me know, please! sad

dfiocch
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: How to...

Hi Stephen,

just trying to do the trick but I'm learning php sad

I have a little idea. Tell me what do you think, please.
In Chameleon I would to do this:

I want to create a CSS class, such as "flag".
In Chameleon, use the function *if ( $fromCountryId == "SOME COUNTRY" )*.
If country match the IP of customer, the CSS class flag has to show the flag of his country.

Something like this:

if ( $fromCountryId == "IT" )

and if div class="flag" ----> show href://*imagepath*/img.png

Sorry, but i'm learning PHP... how can I do that with Chameleon?

Thank you!

dfiocch
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: How to...

I think you should do this with CSS.

Make a rule that detects country "IT" (enter IT into the "Only these countries" box).

In the SUCCEED action, use the (new) control called "HTML head include type 1", and set it to "Raw CSS".

Then in the box below it, enter some CSS which will give your div a background image. Perhaps something like:

div.flag {background-image: url('http://www.site.com/img/myimage.png') }

See a reference like http://www.w3schools.com/css/css_background.asp for more info on CSS background images.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Re: How to...

Thank you for your reply!

Interesting...
Sorry, Stephen. I have to create a new CSS file, right?
Something like "italian.css" (i'm skilled in CSS) and include it in the HEAD with control "HTML head include type 1".

Can't wait! I have to try!

Thank you! big_smile

dfiocch
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1666
Total Polls:
6
Total Posts:
5909
Dormant:
User Info:
 
Total Users:
10093
Newest User:
lamanaudio
Members Online:
0
Guests Online:
145

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked