EllisLab text mark
Advanced Search
     
Plugin and Tag problem
Posted: 06 June 2012 02:18 AM   [ Ignore ]
Joined: 2011-06-22
27 posts

Hello

I did install plugin that should change string with spaces to string without spaces.
Example “Aaa 1” should be"Aaa-1”
As a parameter I did provide tag from other plugin but this is not working. It is returning the same string, more of that when I print in plugin value that I get via $this->EE->TMPL->fetch_param(‘string’, ‘’) I see only tag.
How to change that tag to value?

Code:

//ExpressionEngine super object
$this->EE =& get_instance();

$haystack $this->EE->TMPL->fetch_param('string''');
$needle   $this->EE->TMPL->fetch_param('pattern''');
$replace  $this->EE->TMPL->fetch_param('replace''');

echo 
"<pre>";
print_r ($this->EE->TMPL->fetch_param('string'));
echo 
"</pre>";

//Output transformed string
$this->return_data str_replace($needle$replace$haystack); 
 
Posted: 06 June 2012 12:11 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-18
634 posts

Hi Dominiq,

Can you share your tags also for outputting the modified string?

 Signature 

Bhashkar Yadav
http://www.sidd3.com

 
Posted: 07 June 2012 04:57 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2011-06-22
27 posts

This is part of the code with HTML
exp:strexp - this is that plugin tag that I did put php code above

{exp:ac_memberlist group_id="5" sort="full_name"}
    
<li data-id="id-{member_id}" class="{exp:strexp pattern=" " replace="-" string="{commission}"} {exp:strexp pattern=" " replace="-" string="{position}"}">
    
     <
div class="ts-display-pf-img">
      
      <
img src="{site_url}images/css/content/pf/pf-img1.png" width="150" height="150" alt="" class="rounded member-img" />
      
      <
div class="member-info">
       
       <
strong class="full-name">{full_name}</strong>
       <
div class="clear"></div>
       <
strong>{married_to}</strong>
       <
div class="clear"></div>
       <
strong>{kids}</strong>
       <
div class="clear"></div>
       <
span>{street}</span>
       <
div class="clear"></div>
       <
span>{postal_code}</span>
       <
div class="clear"></div>
       <
span>{email}</span>
       <
div class="clear"></div>
       <
span>{phone_number}</span>
       <
div class="clear"></div>
       <
span>{commission} {position}</span>
       <
div class="clear"></div>
       
      </
div>
      
     </
div>
     
     <
div class="ts-display-clear"></div>
     
    </
li>
{/exp:ac_memberlist} 

 

 
Posted: 20 June 2012 04:03 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2011-06-22
27 posts

Can someone help me? :/