Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » [Solved] How to include Javascript...
[Solved] How to include Javascript directly in MetaMod ?
[Solved] How to include Javascript directly in MetaMod ?
Hi...
Many Thanks to Stephen Brandon, this is a great extension, I very like it
I want to put Javascript (Google Adsense code) directly in Metamod & not include the other module, is this possible ?
Site : http://www.freejoomlatemplatez.com/
Joomla version : 1.57
Metamod version : 1.0g/2.2c
Thanks in advance
24-Jul-10 21:04:24
Re: [Solved] How to include Javascript directly in MetaMod ?
Sure, you can do that. See this page for instructions on how to include HTML (or JS) code directly inside the MetaMod:
http://www.metamodpro.com/metamod/recip … in-metamod
Cheers,
Stephen
Re: [Solved] How to include Javascript directly in MetaMod ?
Hi Stephen...
Many Thanks for your reply.
I've tried a tutorial as you said above and it's work
I want to customize / modificate module display by spesific country and page display, like this :
Countries : US & UK
- Pages : Cat Blog Layout
- JS Code : Google Adsense Code 1
- Pages : Full Article
- JS Code : Google Adsense Code 2
Countries : Except US & UK
- Pages : Category Blog Layout
- JS Code : Google Adsense Code 3
- Pages : Full Article
- JS Code : Google Adsense Code 4
I've read Documentation and Recipes pages, and I got these tutorials :
Code for spesific Country
Code:
if ($fromCountryId == "US")
Code for Category Blog Layout
Code:
if ($option == "com_content" and $view == "category")
Code for Full Article
Code:
if ($option == "com_content" and $view == "article")
Code for include Javascript directly in Metamod
Code:
/* the next line (questionmark greater-than) is important.
* Always put this before a block of html... */
?>
HTML / JAVASCRIPT CODE
<?php
/* after the block of HTML you always have to put the preceding line, even if
* that's the last line of the MetaMod PHP block.
*/
But how to integrate / combine All codes (syntax) above ? I'm very confused because I'm not good in PHP programming
Please help me, Stephen. Thanks in advanced
Regards
Cuki
Re: [Solved] How to include Javascript directly in MetaMod ?
Hi Cuki,
thanks for the additional info - that helps a lot.
Try this, I think it's what you are after:
Code:
if ( $fromCountryId == 'US' or $fromCountryId == 'GB' ) {
if ($option == "com_content" and $view == "category") {
?>
HTML CODE HERE (category view for US and GB users)
<?php
} else if ($option == "com_content" and $view == "article") {
?>
HTML CODE HERE (article view for US and GB users)
<?php
}
}
else { /* for visitors from all other countries: */
if ($option == "com_content" and $view == "category") {
?>
HTML CODE HERE (category view for non-US, non-GB visitors)
<?php
} else if ($option == "com_content" and $view == "article") {
?>
HTML CODE HERE (article view for non-US, non-GB visitors)
<?php
}
}
- Index
- » MetaMod
- » MetaMod General Support
- » [Solved] How to include Javascript...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5944
- Posts this week:
- 2
- User Info:
- Total Users:
- 7655
- Newest User:
- martha48
- Members Online:
- 0
- Guests Online:
- 160
- 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