Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.


fendy
Beginner Modder
ranks
useravatar
User Info

This is an amazing module, but it is not showing up

The module that i want to show based on keywords does not show up on pages with that keyword in content.

First of all I enabled metamod, set it to show none in menus then i just added php code, also the module I want to show I set to none in menus

this is the php code i used and the module dos now show up, do I need to change template, add a hook to template? my site is seoandwebdesign.com THANK YOU SO MUCH FOR THIS MODULE; IT IS A GODSEND

// To set it up, just edit the "$source", "$case_sensitive",
// "$allow_as_substrings", "$names" and "$max_num_modules"
// variables below. The "$names" array contains the
// words/phrases that you want to search for, and the module
// ID or module position to use when any one of them is found.

$source = "content"; /* either "keywords", "description" or "content" */

$case_sensitive = false; /* set to true or false */

/* if you set $allow_as_substrings to true, then the search
* will pick up "billybob thornton" even if you are trying
* to search for "bob thornton". Set it to false to make
* sure that there's an least 1 non-alphabet character on
* each end of the string you are searching for.
*/
$allow_as_substrings = false; /* set to true or false */

$max_num_modules = 3; /* it will just give you the first 3 it finds */

/* In this array, the first part is the text to search for, and
* the last part is the module id to include if that text is
* found. Add as many as you like.
* Remember every line has to end in a comma EXCEPT the last one!
*/
$names = array(
  "jewelry" => 99,
  "diamonds" => 99,
  "retouching" => 99,
  "ring" => 99,
  "photoshop" => 99,
  "retouched" => 99,
  "graphical user interface" => 40
);

/*****************************************/
/* you shouldn't need to edit below here */
/*****************************************/
$document =& JFactory::getDocument();

switch ($source) {
  case "keywords":
  $content = $document->getMetaData('keywords');
  break;

  case "description":
  $content = $document->getMetaData('description');
  break;

  default:
  $buffer = $document->getBuffer();
  $content = $buffer['component'][''];
}

$names_escaped = array();
foreach ($names as $key=>$module) {
  if (!$case_sensitive) {
    $key = strtolower($key);
  }
  $names_escaped[preg_quote($key)] = $module;
}
$names = $names_escaped;
$names_only = str_replace('/','\/',implode("|", array_keys($names)));

$word_boundary = $allow_as_substrings ? '' : '\b';

$result = preg_match_all("/" . $word_boundary
  . "(" . $names_only . ")"
  . $word_boundary . "/"
  . ($case_sensitive ? '' : 'i'), $content, $all);

if ($result > 0) {
  $modules = array();

  foreach ($all[0] as $matched_name) {
    $module = $names[$case_sensitive ?
      $matched_name : strtolower($matched_name)];
    if ( array_search( $module, $modules) === false ) {
      $modules[] = $module;
    }
  }
  if ( count($modules) > $max_num_modules ) {
    return array_slice( $modules, 0, $max_num_modules );
  }
  return $modules;
}


Administrator has disabled public posting
metamodguy
useravatar
User Info

Re: This is an amazing module, but it is not showing up

Hi,

the reason nothing is showing up is because you have to set the MetaMod to show on some pages... the *target* module should be set to menus:none, but the MetaMod itself has to be assigned properly.

Once you've done that it should work :-)

You don't need to do anything to the template.

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

Administrator has disabled public posting
fendy
Beginner Modder
ranks
useravatar
User Info

Re: This is an amazing module, but it is not showing up

I really don't understand, I want the target module to show up if there s a specific keyword in the article, only then. If I enable metamod module to show on all pages, it will show on all pages.
If i set it to show only on specific page, it will show in specific page. I don't understand what you mean you have to set it up properly.

It should popup when there is a jewelry keyword in context for example.


Administrator has disabled public posting
metamodguy
useravatar
User Info

Re: This is an amazing module, but it is not showing up

Hi fendy,

MetaMod is a standard Joomla module (well, a bit more than that...). That means that you have to assign it to a page for anything inside it to be run.

Then inside the MetaMod it will decide whether or not to include any other modules. If it does, then they get included inside the HTML of the MetaMod. If it doesn't, then the MetaMod will be empty.

So you may ask -- "But I don't want the outer MetaMod to show at all - just the inner modules, if the rule succeeds".

That's why you need to do some things:
1 - turn off the title of the MetaMod. Otherwise it's always going to display
2 - sometimes you need to give the MetaMod a random "module css class suffix" to fool the CSS into not realising that the MetaMod is a module, therefore not styling it.

You can read a bit about these setup things in the quick start guide:

http://www.metamodpro.com/metamod/quick-start

Also these FAQs:

http://www.metamodpro.com/metamod/faq/2 … etamod-was
http://www.metamodpro.com/metamod/faq/2 … th-matamod

I hope that gets you going... if you're still having trouble please write back.

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

Administrator has disabled public posting
metamodguy
useravatar
User Info

Re: This is an amazing module, but it is not showing up

By the way your e-mail address is wrong in your registration - can you please change it so that the notification e-mails don't bounce? If you have any problems with it please get in contact via the contact form and include your correct e-mail address. Thanks!

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

Administrator has disabled public posting
fendy
Beginner Modder
ranks
useravatar
User Info

Re: This is an amazing module, but it is not showing up

thanks buddy, top 5 most important modules for joomla, really great work man
i bow your feet, it is really powerful

you can check it here
http://www.seoandwebdesign.com/jewelry_ … y_dvd.html
if there is jewelry on the article, the top form shows up above the article and 3 little banners

and on home page http://www.seoandwebdesign.com/ nothing happens


Administrator has disabled public posting
metamodguy
useravatar
User Info

Re: This is an amazing module, but it is not showing up

Hey it's great to see it's now working - well done smile

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

Administrator has disabled public posting

Board Info

Board Stats:   Total Users: 3075  Total Topics: 1195  Total Polls: 7  Total Posts: 4448  Posts this week: 18
User Info:   Newest User :  Lachlancon   Members Online: 0   Guests Online: 81
Online  There are no members online
Topic
New
Locked
Topic
New
Locked
Sticky
Active
New/Active
Sticky
Active
New/Active
New/Closed
New Sticky
Closed/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky Active Locked
Active/Sticky
Sticky/Locked
Sticky/Active/Locked