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.

Forum module, how i target the home page?

October 14, 2011 9:28am

Subscribe [4]
  • #1 / Oct 14, 2011 9:28am

    John Macpherson

    113 posts

    Hi there,

    How does one target the home page of the forum. The easy way in template would be if segment 1 equals etc but they ( segments) don’t seem to work within the forum.

    Could manage in php which isnt too much bother but wondered if there is native way.

    Thanks.

  • #2 / Oct 14, 2011 12:46pm

    Mark Bowen

    12637 posts

    Hi TheStig,

    Yes I don’t think that segment variables will work from within the forum templates.

    PHP could definitely be used to do this though if you enable it for the module.

    I’ve not looked into this but perhaps you could try placing your code or whatever you are trying to do into one of the theme files for the forum located at :

    themes > forum_themes > theme you are using > forum_index

    Maybe one of those files in there could help with this?

    Does that help?

    Thanks,

    Mark

  • #3 / Oct 14, 2011 12:51pm

    Mark Bowen

    12637 posts

    Hi TheStig,

    One of my colleagues just mentioned that there are actually some special forum segments that are available for use.

    These are current_request, current_page, and current_id.

    So I believe you should be able to do something like this :

    {if current_request == ''}
    Show this note
    {/if}


    Hope that helps a bit.

    Thanks,

    Mark

     

  • #4 / Oct 14, 2011 12:54pm

    Mark Bowen

    12637 posts

    As a quick note :

    If you take the URL of http://example.com/forums/viewthread/24/P5

    current_request is viewthread
    current_id is 24
    current_page is 5

    Thanks must go to Pascal for this as he let me know about those.

    Mark

  • #5 / Oct 17, 2011 6:56am

    John Macpherson

    113 posts

    Magnificent! Working, thanks a lot Mark and team.

    Closed.

  • #6 / Oct 17, 2011 7:43am

    Sue Crocker

    26054 posts

    Glad Mark and Pascal were able to help. Feel free to start a new thread if you have any more questions.

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

ExpressionEngine News!

#eecms, #events, #releases