Announcement

Collapse
No announcement yet.

conditional for cms home or particular section

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [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)?

  • #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


    • #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


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

        Comment


        • #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


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

            Comment


            • #7
              Originally posted by briansol View Post
              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.

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

              Comment

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