Announcement

Collapse
No announcement yet.

How to show code in categories header only

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to show code in categories header only

    Hello,

    I need conditional to show some code at the top of all forums pages but NOT in topics ( to use it in module_title template NOT site builder )

    Example:

    If this is channel ( forumdisplay ) show this code

    CODE HERE

    end if


    Thank you for help.

    #2
    If you could show me a photo of the exact location, I could write you a condition.

    Comment


      #3
      Here it is

      Click image for larger version

Name:	h1.png
Views:	148
Size:	95.6 KB
ID:	21673

      Comment


        #4
        Any help please ?

        Comment


          #5
          You have several options to display something on this location only without using an if conditional.

          Of course, you can use an if conditional if you want to display something exactly there and limit a display to specific users for example.

          Option 1: Go to that location first then use the site builder and drag a Static HTML module there.

          This module will display above the topics only but not in the topic display.

          Option 2: Create a new template with your code and a new plugin, select the hook location channel_display_controls and a template name of your previously created template.

          This will display above the topics only and not in the topic display but under the subforums if you have any.

          Comment


          • Damas
            Damas commented
            Editing a comment
            Option 2: is good for me,
            I will try it and will get back to you in case.
            Thanks a a lot for help.

          #6
          Sorry, not working with me for some reason

          I need to display forum title at the top of all topics list pages ( above subforums list too )

          I use this code but not show up with the plugin I created.
          Code:
          <h1>{vb:raw title}</h1>
          I hope to find conditional like this

          If this not topic page show this

          CODE

          End IF



          I do not want to use builder, It affects all models headers.

          Comment


            #7
            If you want to display only a single template then you don't need to use {vb:raw title} because it will not work in every template without fetching additional data.

            Instead, you should simply write your forum title in that place. It would help a lot if you could explain what exactly you want to do.

            You could try {vb:raw page.title} and set the Hook Arguments to page=page but again I don't think it will work everywhere.

            Comment


              #8
              Click image for larger version  Name:	seo.png Views:	0 Size:	96.6 KB ID:	21683

              Very cool and it appeared with the required pages but I want to raise it to the top of the page, Above Sub-Forums list.

              Reason: The H1 heading must be at the top level of the page for good SEO.

              I appreciate your help.

              Comment


                #9
                I'm afraid that right now this is only possible with Option 1 but there are several other methods that require custom coding.

                For example, you could put your template directly in any of Display Templates using this method {vb:template yourtemplatename}.

                Comment


                  #10
                  WOW

                  Really great and excellent help.

                  I got the required score completely.

                  Thank you with all my heart


                  Click image for larger version

Name:	Good.png
Views:	140
Size:	87.6 KB
ID:	21687

                  Comment


                    #11
                    This result is now



                    I love it
                    Click image for larger version

Name:	w3.png
Views:	139
Size:	403.2 KB
ID:	21689

                    Comment


                      #12
                      I am glad you could achieve what you wanted, thank you for being such a good guy.

                      Comment

                      Users Viewing This Page

                      Collapse

                      There is 1 user viewing this forum topic.

                      • Guest Guest

                      Latest Posts

                      Collapse

                      Working...
                      X
                      Searching...Please wait.
                      An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

                      Please push the back button and reload the previous window.'
                      An unexpected error was returned: 'Your submission could not be processed because the token has expired.

                      Please push the back button and reload the previous window.'
                      An internal error has occurred and the module cannot be displayed.
                      There are no results that meet this criteria.
                      Search Result for "|||"