Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 27 Jun 2015, 07:24
Bastien's Avatar
Bastien Bastien is offline
 
Join Date: May 2015
Question Why do my var doesn't display in its template (sidebar) ?

I'm trying to integrate my chatbox to the sidebar on the forum

My bloc forum calls my template (which displays well
Chatbox [Archives]
output_template : $output)

my bloc content is :

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and calls my template

If I put an echo $output in the forum.php file, it displays well at the top of the forum
But not in my template (whereas I put
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and declared the output var at then end of forum.php

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I need help plizzz
Attached Images
File Type: jpg Capture.jpg (59.0 KB, 9 views)
Reply With Quote
  #2  
Old 27 Jun 2015, 13:50
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
I think your problem is this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Since variables aren't evaluated in single quotes, you're setting the string to a literal $output. I don't think you need that line at all, just use return $output;
Reply With Quote
  #3  
Old 28 Jun 2015, 12:02
Bastien's Avatar
Bastien Bastien is offline
 
Join Date: May 2015
If I don t add it, the bloc disent display at all I think ...
Reply With Quote
  #4  
Old 28 Jun 2015, 13:06
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
I'm not exacly sure what you're trying to do. Where does $output get set?
Reply With Quote
  #5  
Old 28 Jun 2015, 15:16
Bastien's Avatar
Bastien Bastien is offline
 
Join Date: May 2015

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The commented line //echo "output_fichier : $output"; if uncommented, displays the chatbox at the top of the page in my SC

whereas in my template, this


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Only displays : output template $output
Reply With Quote
  #6  
Old 28 Jun 2015, 16:06
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
The code you posted above, where so you have that? Is it in a plugin, in the forum block, or in forum.php?

You mentioned you template. What template is it, and where is the code that renders it? You said you added a call to $templater->register at the end of forum.php? Is hat where your template rendering code is, or are you adding it to the line for registering to FORUMHOME?
Reply With Quote
  #7  
Old 28 Jun 2015, 16:54
Bastien's Avatar
Bastien Bastien is offline
 
Join Date: May 2015
This code is my forum.php

I m trying to do a "plugin" to add the chatbox in the side bar !

The content of my bloc is


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and this bloc displays this template chatboxtoutcourt whichs contains :


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But this fu**in' var doesn't display in my template, whereas with the echo it does !
Reply With Quote
  #8  
Old 28 Jun 2015, 17:24
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
OK, I think what you could do is to change the output part of the template to this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Then in the bloc code, do this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

(although it might be better to use a variable other than $output). Because the sidebar code will automatically take what is returned and register it to 'content' in the block template. You just need to make sure that $output is set before the sidebar is rendered.

You could also put all the code in the bloc content area, and return $output at the end, but maybe you're not doing that because you need $show['mgc_cb_evo'] set before it gets to the block code?
Reply With Quote
  #9  
Old 29 Jun 2015, 13:05
Bastien's Avatar
Bastien Bastien is offline
 
Join Date: May 2015
Thank you it works great !
Attached Images
File Type: png Capturer.PNG (49.9 KB, 8 views)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 19:38.

Layout Options | Width: Wide Color: