PDA

View Full Version : Can't get Thread views to show up on widget


popular
03-18-2011, 04:33 AM
Trying to get thread views to show up on Recent Thread Widget by editing "vbcms_widget_recentthreads_page" and adding this in {vb:raw thread.views} but it does nothing. What am I doing wrong?

Lynne
03-18-2011, 04:24 PM
You can't just throw a variable into a template and expect results. You need to actually define the variable if you want something to show up. Have you defined it somewhere?

popular
03-18-2011, 04:53 PM
Oh I see, I haven't defined the variable.. Could you tell me how to define it and how do I know if a variable is already defined or not in a template?

Sorry I'm kinda new at this.. I just found {vb:raw thread.views} in the "threadbit" template and assumed it would work =(

Lynne
03-18-2011, 05:03 PM
You can find if it is defined by looking to see where the template is rendered. Do a search in your vbulletin files for the template (vbcms_widget_recentthreads_page - it's used in recenthreads.php and recentposts.php) and then look around there and see which variables are defined. In this case, it is CMS stuff and I am not that familiar with coding there.

popular
03-18-2011, 07:01 PM
Thanks! I found the recenthreads.php and recentposts.php and I fixed my problem but I'm still not sure how you were able to find the location where the template is rendered could you elaborate a little or is it in the vb manual? Sorry for the trouble!

Lynne
03-18-2011, 07:14 PM
I just did a search on the template name in the vbulletin files. That is a function in my text editor - it has nothing to do with vbulletin.