We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

module help

Development and Programming

thisconnect.be's avatar
thisconnect.be
73 posts
about 18 years ago
thisconnect.be's avatar thisconnect.be

Hi guys,

I’am trying to create a new module. Now i’am trying to print something out let me show you in code:

This is my template tags:

{exp:weblog:entries weblog="default_site"}
{exp:select_blog field="{myext}"}
{select_weblog}
{/exp:select_blog}
{/exp:weblog:entries}

Below is the function that processes it. When i output $weblogname it displays the result as expected. But the template does not display the name as i would expect.What am i missing or doing wrong? Many thanks in advance!

class Select_blog {
    
    function Select_blog()
    {
        global $TMPL, $DB, $SESS, $FNS;
        $tagdata = '';
        
        if($TMPL->fetch_param('field'))
        {
            $field = trim(strip_tags($TMPL->fetch_param('field')));
            //var_dump($field);
            $exploded = explode("|", $field);
            $weblogname = $exploded[0];
            $category = $exploded[1];
            //$result = array("select_weblog" => $weblogname, "select_cat_id" => $category);
            //var_dump($result);
            //$tagdata .= $TMPL->tag_data;
            
            /**
            $cond['select_weblog'] = $weblogname;
            $cond['select_cat_id'] = $category;
            $tagdata = $FNS->prep_conditionals($tagdata, $cond);
            */

            foreach ($TMPL->var_single as $key => $val)
            {
                switch ($key)
                {
                    case "select_weblog":
                    $tagdata = $TMPL->swap_var_single($val, $weblogname, $tagdata);
                    break;
                }
            }
            $this->return_data = $tagdata;
        }
    }
    
}
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.