Announcement

Collapse
No announcement yet.

unordered lists in v8

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

    unordered lists in v8

    1st posting over on the v8 forum, nice product, but I want to stretch it a little.

    is there anyway that I can create a fragment? or a template? or a ??? in v8 that will allow the end user to add additional items to the list (ad infinitum) and have my CSS handle the entries the user creates.

    reason:
    many of the products have technical details (speed, weight etc) and I need to allow the user to edit/add these details without screwing up the concept of the < UL> . . . < /UL> concepts that is re-formatted using CSS - clearly all the users needs to do is to play with the actual entries on the list.

    kev

    #2
    So is this a bulleted list for user-definable variables for products? I have done this successfully with the following method:

    Assuming you have two user-definable variables called 'Manufacturer' and 'Size', include your user-definable variables into your product layouts with the following code:

    <li>Manufacturer: Manufacturer</li>
    <li>Size: Size</li>

    Then use conditional 'block' tags to hide the lines if the user-definable variable has no value. To do this:
    1. Highlight the 'Manufacturer' line
    2. Click the 'Insert Block' button (white 'C' in green circle with a '+'
    3. Create a condition that says Manufacturer != "" (i.e. true if Manufacturer is filled in)
    4. You can then do the same for the 'Size' line.
    This then leaves the issue of the <ul> at the top of the list and the </ul> at the end. I'd put some conditional block tags in here that say 'Only show these tags if Manufacturer is filled in, or Size is filled in.

    Hope that gives you a place to start.

    Comment


      #3
      Thanks for the update.

      I can follow the idea behind the User-Variables, I've already go the manufacturer etc set for internal use and none-searchable.

      My idea was that I wanted the user to be able to add as many entries here as they wanted WITHOUT going to the hassle of creating variables and filling them out on the Properties, Attributes section of the product.

      The "slightly warped" idea I had in mind was to so some clever formatting at the top with a < UL> etc, allow them to add the equivilent of as many fragments as they want, each one showing up in the content-tree and for every one they enter, us this as the < LI>fragmentText</LI> type of formatting, then finish it off with a < /UL> statement at the end.
      This way, I control the formatting, but in one product they would be able to put "max speed", another one "max user weight", another one could have both entries ad infinitum

      its sort of user controlled fragments that end up being used as a < UL> type of entry,

      Hope that makes a bit of sense.

      If I can do it this way, Can I create a new item (based upon "fragments") but called "TechEntry" and have the "techEntry" show up where the "new fragment" and "New choice" shows up

      OR

      do I just have a new layout of the fragments called "TechEntry" formatted as required. This being the case, how do I create the < UL> < /UL> entries at the top and bottom?

      kev

      Comment


        #4
        do I just have a new layout of the fragments called "TechEntry" formatted as required. This being the case, how do I create the < UL> < /UL> entries at the top and bottom?
        Good question.

        I think this is the right approach - but there needs to be some sort of condition that includes the <ul>s and </ul>s correctly.

        What about if you put <ul> at the end of each standard product layout and </ul> at the start of each product layout. That way - as the fragments are effectively going to be inserted 'between' products - the products can insert the required tags.

        You then need a condition to stop a </ul> to stop appearing at the top of the product list, and <ul> from appearing at the bottom. This is quite easy

        The condition around the </ul> at the top of the product layout needs to be:

        ListIndex != 1

        (i.e. only show it when the product is not the first in the list)

        Then the one for the bottom <ul> is:

        ListIndex != ListCount

        (i.e. only show it if the product is not the last in the list)

        Comment


          #5
          I need to digest this one and play with conditions. I think I follow although I may come back.

          in the mean time, I have already been playing with Fragments and before I received the reply, I created a "TechDetailStart" and a "TechDetail" and a TechDetailEnd" which effectively did the < UL> < LI></LI> < /UL> scenario as required.

          I'm going to change the internals to do something like you suggest and get rid of the Start and End,

          The page displayed correctly, BUT the css format wasn't quite as expected. Clearly Fragments have thier own css format, and I need to get rid of that (without affecting the standard Fragments) and put my own styling in for the "TechDetails"

          Can you point me in the right direction to play about with CSS styling on the new fragments I make and to disable the current default CSS style please

          regards

          Kev

          Comment


            #6
            BUT the css format wasn't quite as expected. Clearly Fragments have thier own css format, and I need to get rid of that (without affecting the standard Fragments) and put my own styling in for the "TechDetails"

            Can you point me in the right direction to play about with CSS styling on the new fragments I make and to disable the current default CSS style please
            There isn't any CSS specifically aimed at fragments. If you remove any <span> or <div> tags from your custom fragment layout, then the the text in the fragment will just display as basic text.

            Comment


              #7
              Chris - I've been playing around with this a lot and I can't make it work.
              you suggest using the "ListIndex != ListCount" syntax.
              I've followed your example, but that didn't work so I ended up with the following.

              example:
              I've created three fragments.
              TechnicalDetailsBegin:
              Code:
              </ul>
              TechnicalDetailsEntry:
              Code:
               <li>list count: <actinic:variable name="ListCount" /><br>list index : <actinic:variable name="ListIndex" />
              </li>
              TechnicalDetailsFinal:
              Code:
              </ul>
              then within the actual product, I've created four fragments with the following layouts:
              TechnicalDetailsBegin, TechnicalDetailsEntry, TechnicalDetailsEntry, TechnicalDetailsFinal

              when I look at the actual generated code I see that the ListIndex seems to start at TWO and EVERY fragment that I have included then generates an actual new entry to the ListCount (even if I don't use the <li> syntax within that fragment.)

              whats more strange, is that I don't have ANY fragments about the fragment called TechnicalDetailsBegin so why doesn't it start at ONE.

              If I then include the same four fragments for a SECOND time, the ListCount doesn't get reset (despite a </ul> and the </UL>) and the ListIndex equals the TotalNumberOfFragments+1 - surely this should happen.

              got any clue what next.

              kev

              Comment


                #8
                why doesn't it start at ONE.
                The ListCount includes the product at the top - sorry, forgot about that - so I don't think the ListIndex and ListCount method is going to work.

                The only way to do is is to have one layout for the first fragment and one for the last one.

                Comment

                Working...
                X