conditional for cms home or particular section

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rmd708
    Member
    • Feb 2006
    • 88

    [CMS] conditional for cms home or particular section

    I want to display a piece of html code only on the cms homepage. Is there a conditional for this or a conditional for particular sections (like latest articles section, which is the homepage)?
  • rmd708
    Member
    • Feb 2006
    • 88

    #2
    P.S. I already tried a conditional "if script = index", but that also applies to all the article pages, since all of them are using content.php. I want to isolate only the homepage.

    Comment

    • Lynne
      Former vBulletin Support
      • Oct 2004
      • 26255

      #3
      You could always use the section title:
      Code:
      <vb:if condition="$html_title == 'Home Page'">hello</vb:if>

      Please don't PM or VM me for support - I only help out in the threads.
      vBulletin Manual & vBulletin 4.0 Code Documentation (API)
      Want help modifying your vbulletin forum? Head on over to vbulletin.org
      If I post CSS and you don't know where it goes, throw it into the additional.css template.

      W3Schools &lt;- awesome site for html/css help

      Comment

      • rmd708
        Member
        • Feb 2006
        • 88

        #4
        Will this work in custom templates? I tried it in a custom template and $html_title is equal to '' (nothing).

        Comment

        • Lynne
          Former vBulletin Support
          • Oct 2004
          • 26255

          #5
          It works in the main template for the page - vbcms_page. If you want it in custom templates, you will have to register any variables you want to use in there after you make sure it is available at that point in the code. For help with that, there is an article over on vbulletin.org. If you need further help with that, then that is also the place to post for help.

          Please don't PM or VM me for support - I only help out in the threads.
          vBulletin Manual & vBulletin 4.0 Code Documentation (API)
          Want help modifying your vbulletin forum? Head on over to vbulletin.org
          If I post CSS and you don't know where it goes, throw it into the additional.css template.

          W3Schools &lt;- awesome site for html/css help

          Comment

          • briansol
            Senior Member
            • Apr 2006
            • 674
            • 3.6.x

            #6
            I've also had no luck with this, on vbcms_page (not custom scripts).

            Comment

            • Lynne
              Former vBulletin Support
              • Oct 2004
              • 26255

              #7
              Originally posted by briansol
              I've also had no luck with this, on vbcms_page (not custom scripts).
              Have you tried using $_GET['r'] in your conditional for the sections (if that is what you are asking about - $_GET['r'] == '1-Index' ).

              Please don't PM or VM me for support - I only help out in the threads.
              vBulletin Manual & vBulletin 4.0 Code Documentation (API)
              Want help modifying your vbulletin forum? Head on over to vbulletin.org
              If I post CSS and you don't know where it goes, throw it into the additional.css template.

              W3Schools &lt;- awesome site for html/css help

              Comment


              • malmazan
                malmazan commented
                Editing a comment
                I'm also looking for this. Specifically I want to show a widget on the main listing but not the articles themselves (there are thousands so manually selecting a layout is not an option)

              • Mark.B
                Mark.B commented
                Editing a comment
                This will require custom coding. For help with this, please ask on www.vbulletin.org, the modification site.
            • malmazan
              Senior Member
              • Jan 2006
              • 974
              • 4.2.X

              #8
              I was able to make it work with <vb:if condition="$vbulletin->nodeid == 1">
              Vote for these issues:

              Comment

              • wraggster
                New Member
                • Feb 2009
                • 14

                #9
                Originally posted by malmazan
                I was able to make it work with <vb:if condition="$vbulletin->nodeid == 1">
                do you have the code for this, i cant get a link to show on the cms front page only

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...