Announcement

Collapse
No announcement yet.

wrap single div element around whole section list?

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

    wrap single div element around whole section list?

    i am wanting to wrap a containing div element around the section list code. From looking inside design > Text > html (lines 1187, 1188, 1189, 1190) i can't see any way to do this, as lines 1187, 1188 get used for each category row.

    what i want to do is surround the whole section list html with my own div tag so i can use css to control the display.

    any ideas?

    #2
    Do it in the Templates. E.g. in Act_Primary.html or Act_ProductBody.html
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks for your help Norman.

      This sort of works - in that i can surround the section list with the div tag. The problem is now that i don't want the div tag to appear when there is no section list output on the page.

      I am grappling around with some javascript to detect if NETQUOTEVAR:SECTIONLISTTOP is empty or not. I will then be able to display my div only when there is a section list output.

      Problem i am up against when setting a variable to the netquotevar is it doesn't like it as it's got loads of quotes in there + other funny characters (error: unterminated string literal).

      I'll see if i can get the javascript to work using escape function.

      Comment


        #4
        You can use either '...' or "..." to enclose string constants. One or the other usualy works.

        Also you can use a CUSTOMVAR at the Section level to define the class for that DIV.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Thanks for that Norman.

          I'll look into the use of customvar for the div class.

          I have enclosed my NETQUOTEVAR:SECTIONLISTTOP with '' in the javascript. I've found out that the prolem is that there is a carriage return in the code generated in the netqoutevar, so i can't set a variable to it. Just looking on the web to see how to handle strings like this as is useful knowledge to have - plenty of info on how to set strings with returns, but not much on how to handle strings that already have them in!

          Comment


            #6
            JavaScript uses a new line as the end of a statement (unless it's obvious from the context that a statement needs more lines). I doubt that there's a workaround.

            Interestingly PHP does allow multi-line string constants.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Got it working by assigning CUSTOMVAR to the categories. The only problem is now that i can't attach this CUSTOMVAR to the root category, hence i can't make the div class display round the section list in index.html.

              i may try and use javascript to detect the location for this instance, and get round it that way.

              Comment


                #8
                Root level Customvar's are set via Design / Options / Site Defaults / Properties.

                Their values will be available for all Sections / Products unless you redefine them at the Section or Product level.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Thanks very much Norman - was quite a basic thing i was missing. Sorted now.

                  Comment

                  Working...
                  X