ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to output {include:visitor_stats} in forums?

September 19, 2011 12:59pm

Subscribe [5]
  • #1 / Sep 19, 2011 12:59pm

    siffring

    147 posts

    I’m trying to output visitor stats at the bottom of every EE2 forum page.

    I couldn’t find any documentation on what tags are available in the forum templates, but found the {include:visitor_stats} tag in the default theme.

    I added {include:visitor_stats} to the bottom of my forum_global/html_footer.html theme file, but it’s not outputting anything.

    If it matters, I’m displaying the forums via EE template using the {exp:forum} tag that you have documented.

    Can you provide more details on how the {include:visitor_stats} tag works and why it isn’t displaying anything?

    I’m on EE 2.2.2 Build 20110801. Thanks.

  • #2 / Sep 19, 2011 4:11pm

    siffring

    147 posts

    I’ve noticed another peculiarity.

    The stats are not displayed on the forum list or thread pages. But, they do appear on the forum register and forum profile pages. But, even when they are displayed some of the stats aren’t rendered.

    See attached.

    These pages don’t show any stats:
    /forums/ (Forum home page rendered in the EE template group called forums, template called index.)
    /forums/viewforum/3/ (Forum topic list)
    /forums/viewthread/1/ (Forum thread)

    These pages show some stats, but also show some unparsed EE tags.
    /forums/account/profile (profile page)
    /forums/account/register (sign up page)

    Also, here are a couple key settings:
    Member Preferences > Profile Triggering Word = account
    Modules > Discussion Forum > Forum Management > General Settings > Forum Triggering Word = abc123 (because I’m using the EE template to display the forum)

  • #3 / Sep 20, 2011 10:37am

    Kevin Smith

    4784 posts

    Hi siffring,

    If you try using the default forum theme that’s included with the Forum Discussion module, do you still see problems displaying visitor stats? This is a good thing to check first since it will let us know whether or not there’s a problem with EE or just a problem in your themes.

    The {include:visitor_stats} tag should be used in the forum_index/forum_homepage.html file, and it serves to include the forum_stats/visitor_stats.html page, so whatever you have within that file will be displayed wherever you put that tag in your forum_homepage.html theme file.

    Where did you put that tag, and what do you have included in your visitor_stats.html theme file?

    When troubleshooting the forum theme files, it always helps to take a second look at where your tags are located (nesting, in certain theme files, etc.) Compare them to the default theme that comes with the module.

  • #4 / Sep 20, 2011 11:16am

    siffring

    147 posts

    The {include:visitor_stats} tag doesn’t output anything on the forum home page when using the default theme either. I confirmed that the tag is in the forum_index/forum_homepage.html file and added some text to make sure that file was getting called.

    FWIW, here’s the EE template I’m using to build the forum pages.

    {embed="site/.header" title="Forums" pageid="forumpage"}
      
      {exp:forum}
    
    {embed="site/.footer"}
  • #5 / Sep 20, 2011 1:32pm

    siffring

    147 posts

    Here’s another data point.

    Plugins and module tags are not working on the forum user management pages, but work everywhere else.

    I noticed that my NavEE navigation wasn’t outputting anything on the forum user management pages (e.g. /forums/account/register/). Then I tried and Image Sizer tag and that wouldn’t work on those pages either.

    Those pages are the only ones that generate any output for the forum stats tag.

    So, what is unique about the forum user management screens that would cause the forum stats tag to generate output but not allow any modules or plugins to generate output?

    This is starting to smell like some kind of parse order issue or bug to me.

  • #6 / Sep 20, 2011 2:24pm

    Michael Witwicki

    115 posts

    Hey guys,

    Just wanted to add to the documentation here that we had Jason try nesting embeds with the module on it’s own template - and that didn’t work either.

    Michael

  • #7 / Sep 21, 2011 5:29pm

    Kevin Smith

    4784 posts

    The {include:visitor_stats} tag doesn’t output anything on the forum home page when using the default theme either. I confirmed that the tag is in the forum_index/forum_homepage.html file and added some text to make sure that file was getting called.

    FWIW, here’s the EE template I’m using to build the forum pages.

    {embed="site/.header" title="Forums" pageid="forumpage"}
      
      {exp:forum}
    
    {embed="site/.footer"}

    Yep, I think Michael Witwicki caught the problem before I got to it. Notice in the documentation that

    {exp:forum}

    is the only code you can place in the template for the forums. That’s followed in the docs with:

    Your forum will then be run inside the regular EE template engine, which means that you can include standard EE Tags in the forum theme Templates.

    So any tags you want to include in your forums need to be in your actual forum theme files, not in the template where {exp:forum} is located.

  • #8 / Sep 21, 2011 5:39pm

    siffring

    147 posts

    I’m not sure I totally follow.

    Are you saying that my EE template should look more like this?

    {embed="site/.header" title="Forums" pageid="forumpage"}
      
      {embed="site/forum"}
    
    {embed="site/.footer"}

    And then the new site/forum template contains this (and only this):

    {exp:forum}
  • #9 / Sep 22, 2011 1:29pm

    Mark Bowen

    12637 posts

    Hi siffring,

    As the documentation states you should only have {exp:forum} in a template and nothing else other than standard ExpressionEngine tags. The {include:visitor_stats} is a special tag which is only available / works from within the forum theme files.

    You can’t place it within an ExpressionEngine template like you are trying to do.

    Does that help?

    Thanks,

    Mark

  • #10 / Sep 22, 2011 1:39pm

    siffring

    147 posts

    The {include:visitor_stats} tag IS inside the forum theme files. The template code you see above is the entire EE template.

    Do 3rd party add-on tags work in EE templates that include the {exp:forum} tag? Because that’s the problem we’re seeing here. No 3rd party add-on tags are outputting anything.

  • #11 / Sep 23, 2011 10:40am

    Mark Bowen

    12637 posts

    Hi siffring,

    Unfortunately we can’t offer any support for 3rd party add-ons so you would need to go to the authors of those directly to see if they can help in that matter.

    With regards to using the forum module within a template though, as the documentation states :

    Inside that new Template, place this code and only this code:

    {exp:forum}

    So you should literally only have that code in your template and nothing else. No embeds, nothing.

    With regards to using any other tags they have to go inside the forum theme templates and not the template that you created with the {exp:forum} tag in it.

    Does that help at all?

    Thanks,

    Mark

     

  • #12 / Sep 27, 2011 5:26pm

    siffring

    147 posts

    OK, I think I understand. My EE template now includes only:

    {exp:forum}

    And I updated the html_header.html and html_footer.html in my forum theme to embed my EE template header and footer templates.

    However, it still appears that no third party tags output anything when included in the forum templates. Is this expected?

    I’m not asking to you to support any third party add-ons. I’m just asking if EE supports the ability for third party tags to work in forum theme files?

    The docs say,

    you can include standard EE Tags in the forum theme Templates.

    which made me expect that all tags would work. So, if it’s first-party tags only then I’ll add a note to the docs to clarify.

  • #13 / Sep 27, 2011 6:51pm

    Mark Bowen

    12637 posts

    Hi siffring,

    I just did a very quick test with the CE Gravatar plugin and placed it into the header template of a forums install and that worked so it seems like possibly some 3rd party add-ons will indeed work but this may well be something you would need to contact the author of the add-ons you’re trying to use here to see if they have any more information on this.

    I will however bring this up internally to see if there is any information on this though and will post back here with my findings.

    Thanks,

    Mark

  • #14 / Sep 27, 2011 7:11pm

    Mark Bowen

    12637 posts

    Hi siffring,

    I’ve just been told that yes 3rd party add-ons are supported as long as you are using the {exp:forum} feature which is indeed what you’re doing here.

    As I can get this working fine with a quick test add-on as shown above then we would have to ask you to contact the 3rd party add-on developer about this as we can’t support their add-ons here.

    Hope that answers your questions though?

    Thanks,

    Mark

  • #15 / Sep 28, 2011 5:19pm

    siffring

    147 posts

    Thanks Mark.

    As an interesting side note, the 3rd party add-on tags are working properly inside the forum theme on the core forum pages, but not on the forum user profile pages.

    These pages correctly output all 3rd party tags:
    /forums/ (Forum home page rendered in the EE template group called forums, template called index.)
    /forums/viewforum/3/ (Forum topic list)
    /forums/viewthread/1/ (Forum thread)

    These pages don’t output any 3rd party tags:
    /forums/account/profile (profile page)
    /forums/account/register (sign up page)

    That feels a little buggy to me. Do you see that on your’s?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases