Skip to main content
Inspiring
October 8, 2024
Answered

Help Formatting Autonumbers with Attributes

  • October 8, 2024
  • 2 replies
  • 469 views

Hi, 

I'm setting up my first EDD. I'm trying to create a list element that allows the user to select attributes for bulleted or numbered formatting. I thought I had copied the Delveoper Guide pretty closely, but it's not working.

 

Can someon explain what I'm doing wrong?

 

Here's what I have in the EDD:

Element (Container): List
   General rule: List-item+
   Attribute list
      Name: List-type    Choice    Required
      Choices: Bulleted, Numbered
   Automatic insertions
      Automatically insert child: List-item
   Text format rules
      In all contexts.
         Basic properties
            Indents
               First indent: 0.1in
               Left indent: 0.25in
            Paragraph spacing
               Space above: 4pt
            Tab Stops
               Tab stop position: 0.25in
   If context is: List-item [List-type = ”Bulleted”]
      Numbering properties
         Autonumber format: \b\t
   Else, if context is: List-item [List-type = ”Numbered”]
      Numbering properties
         Autonumber format: <n>.\t

 

This is what it looks like whether I select the Bulleted or Numbered attribute:

Paragraph paragraph paragraph

   list

   list

   list

 

    This topic has been closed for replies.
    Correct answer Lynne A. Price

    Hanna,

       Your element definition is almost right. The problem is that you are specifying all formatting on the List element, which is OK in a simple structure, but you are testing whether that List is in a ListItem.

       The simplest fix would be to change the context specification from:

          List-item [List-type = ”Bulleted”]

    to simply

         [List-type = "Bulleted"].

    Another approach would be to move the context rule into the definition of List-item and change the context rule to 

          List[List-type = ”Bulleted”]

    Something else you'll need to account for is resetting the counter if there is more than one list in the document and you don't already reset it.

             --Lynne

    2 replies

    Dave Creamer of IDEAS
    Community Expert
    Community Expert
    October 8, 2024

    This is what I've used--this is from my Para tag which has a lot of context uses.

    (Sorry--was too lazy to indent...)

    Else, if context is: Item
    If context is: Item < List[Type="Bullet"]
    Count ancestors named: List
    If level is: 1
    Use paragraph format: Body_BulletList1
    Else, if level is: 2
    Use paragraph format: Body_BulletList2
    Else, if level is: 3
    Use paragraph format: Body_BulletList3
    Else, if context is: Item < List[Type="Numbered"]
    Count ancestors named: List
    If level is: 1
    If context is: Item{first} < List
    Use paragraph format: Body_NumberList_L1reset
    Else
    Use paragraph format: Body_NumberList_L1
    Else, if level is: 2
    Use paragraph format: Body_NumberList_L2
    Else, if level is: 3
    Use paragraph format: Body_NumberList_L3
    Else, if context is: Item < List[Type="QandA"]
    Count ancestors named: List
    If level is: 1
    Use paragraph format: Q_Question
    Else
    Use paragraph format: Q_Answers

     

    Link to file:

    EDD_Master.fm

     

     

    David Creamer: Community Expert (ACI and ACE 1995-2023)
    Inspiring
    October 8, 2024

    That's very helpful, thanks!

    Lynne A. PriceCorrect answer
    Inspiring
    October 8, 2024

    Hanna,

       Your element definition is almost right. The problem is that you are specifying all formatting on the List element, which is OK in a simple structure, but you are testing whether that List is in a ListItem.

       The simplest fix would be to change the context specification from:

          List-item [List-type = ”Bulleted”]

    to simply

         [List-type = "Bulleted"].

    Another approach would be to move the context rule into the definition of List-item and change the context rule to 

          List[List-type = ”Bulleted”]

    Something else you'll need to account for is resetting the counter if there is more than one list in the document and you don't already reset it.

             --Lynne

    Inspiring
    October 8, 2024

    Thank you!