Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • packyr Friend
    #202533

    Trying to load a gallery style1 in an article. I used the sintax {loadmodule mod_ja_acm,module name}
    I actually view all the thumbnails in the article and the hover animation effect does work too. The problem is if I clicked on a thumbnail, gallery doesn’t work. A new page just loads the single image I clicked on (http://www.mysite.com/images/album/image.jpg). What do I do wrong?

    pavit Moderator
    #554566

    Hi

    Could you post a link to the page where this happens ?

    pavit Moderator
    #554568

    Hi

    You should verify how the module is configured, that has nothing to do with the template itself or to the loadmodule plugin

    If you publish same module in a normal page what happens ?

    packyr Friend
    #554569

    If I publish the module in a normal page, it works properly.

    pavit Moderator
    #554570

    Ok

    Could you send me via Private Message a super user account to your backend ? i will try to take a look

    jooservices Friend
    #554596

    Hi there,
    Please have right know about Joomla! load module in article


    http://docs.joomla.org/How_do_you_put_a_module_inside_an_article%3F

    # It’s triggered via Joomla! content plugin.


    /**
    * Plugin that loads module positions within content
    *
    * @param string $context The context of the content being passed to the plugin.
    * @param object &$article The article object. Note $article->text is also available
    * @param mixed &$params The article params
    * @param integer $page The 'page' number
    *
    * @return mixed true if there is an error. Void otherwise.
    *
    * @since 1.6
    */
    public function onContentPrepare($context, &$article, &$params, $page = 0)
    {
    // Don't run this plugin when the content is being indexed
    if ($context == 'com_finder.indexer')
    {
    return true;
    }

    // Simple performance check to determine whether bot should process further
    if (strpos($article->text, 'loadposition') === false && strpos($article->text, 'loadmodule') === false)
    {
    return true;
    }

    // Expression to search for (positions)
    $regex = '/{loadpositions(.*?)}/i';
    $style = $this->params->def('style', 'none');

    // Expression to search for(modules)
    $regexmod = '/{loadmodules(.*?)}/i';
    $stylemod = $this->params->def('style', 'none');

    // Find all instances of plugin and put in $matches for loadposition
    // $matches[0] is full pattern match, $matches[1] is the position
    preg_match_all($regex, $article->text, $matches, PREG_SET_ORDER);

    // No matches, skip this
    if ($matches)
    {
    foreach ($matches as $match)
    {
    $matcheslist = explode(',', $match[1]);

    // We may not have a module style so fall back to the plugin default.
    if (!array_key_exists(1, $matcheslist))
    {
    $matcheslist[1] = $style;
    }

    $position = trim($matcheslist[0]);
    $style = trim($matcheslist[1]);

    $output = $this->_load($position, $style);

    // We should replace only first occurrence in order to allow positions with the same name to regenerate their content:
    $article->text = preg_replace("|$match[0]|", addcslashes($output, '\$'), $article->text, 1);
    $style = $this->params->def('style', 'none');
    }
    }

    // Find all instances of plugin and put in $matchesmod for loadmodule
    preg_match_all($regexmod, $article->text, $matchesmod, PREG_SET_ORDER);

    // If no matches, skip this
    if ($matchesmod)
    {
    foreach ($matchesmod as $matchmod)
    {
    $matchesmodlist = explode(',', $matchmod[1]);

    // We may not have a specific module so set to null
    if (!array_key_exists(1, $matchesmodlist))
    {
    $matchesmodlist[1] = null;
    }

    // We may not have a module style so fall back to the plugin default.
    if (!array_key_exists(2, $matchesmodlist))
    {
    $matchesmodlist[2] = $stylemod;
    }

    $module = trim($matchesmodlist[0]);
    $name = htmlspecialchars_decode(trim($matchesmodlist[1]));
    $stylemod = trim($matchesmodlist[2]);

    // $match[0] is full pattern match, $match[1] is the module,$match[2] is the title
    $output = $this->_loadmod($module, $name, $stylemod);

    // We should replace only first occurrence in order to allow positions with the same name to regenerate their content:
    $article->text = preg_replace("|$matchmod[0]|", addcslashes($output, '\$'), $article->text, 1);
    $stylemod = $this->params->def('style', 'none');
    }
    }
    }

    It’s mean this plugin only trigger when onContentPrepare is triggered. Mostly in com_content
    # For same case 3rd extension make integration with com_content to load content, but it does not mean they do trigger onContentPrepare even, than of course {loadmodule …} will not replaced by right module
    # And even module is replaced but some special can’t work inside article because some css / js conflicted.

    Please consider about these 🙂

    Thank you,
    Viet Vu

    max_santiago Friend
    #572902

    Uhm …and then is it pointless to put {loadposition module_gallery_name} in an article!

    If we lose gallery scrolling it’s pointless link module into an article.
    Is there a workaround to solve this ‘necessity’?!

    Thanks.

    M.

    max_santiago Friend
    #737936

    Uhm …and then is it pointless to put {loadposition module_gallery_name} in an article!

    If we lose gallery scrolling it’s pointless link module into an article.
    Is there a workaround to solve this ‘necessity’?!

    Thanks.

    M.

    jooservices Friend
    #572904

    Hi there
    Yes. You can render module anywhere in Joomla! with basic PHP

    http://joomla.stackexchange.com/questions/1054/displaying-a-joomla-module-using-php

    Thank you,
    Viet Vu

    jooservices Friend
    #737938

    Hi there
    Yes. You can render module anywhere in Joomla! with basic PHP

    http://joomla.stackexchange.com/questions/1054/displaying-a-joomla-module-using-php

    Thank you,
    Viet Vu

Viewing 10 posts - 1 through 10 (of 10 total)

This topic contains 10 replies, has 4 voices, and was last updated by  jooservices 9 years, 5 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum