Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9180831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:08:48+00:00 2026-06-17T18:08:48+00:00

I am trying to wrap every 3rd item in a menu generated with TypoScript.

  • 0

I am trying to wrap every 3rd item in a menu generated with TypoScript.

This is my menu:

tt_content.menu.20.4 >
tt_content.menu.20.4 < tt_content.menu.20.1
tt_content.menu.20.4.stdWrap.outerWrap = <div class="my-menu">|</div>
tt_content.menu.20.4.1.wrap = <ul>|</ul>
tt_content.menu.20.4.1.NO {
    doNotLinkIt = 1
    stdWrap.htmlSpecialChars = 0
    stdWrap.cObject = COA
    stdWrap.cObject {
        # title
        10 = TEXT
        10 {
            field = title
            typolink.parameter.field = uid
            typolink.ATagParams = class="more"
        }

        # abstract
        20 = TEXT
        20 {
            field = abstract
            htmlSpecialChars = 1
            wrap = <span>|</span>
        }
    }
}

Via How can I apply a different wrap to every menu item? I know how to wrap every item different, is there a way to wrap three items together?
And when there are more than 3 % x = 0 items, e.g. 14, the last opening tag has to be closed with the last item.

Current output:

<ul class="csc-menu csc-menu-1">
    <li>
        <a href="index.php?id=1">Page 1</a>
    </li>
    <li>
        <a href="index.php?id=2">Page 2</a>
    </li>
    <li>
        <a href="index.php?id=3">Page 3</a>
    </li>
    <li>
        <a href="index.php?id=4">Page 4</a>
    </li>
    <li>
        <a href="index.php?id=5">Page 5</a>
    </li>
    <li>
        <a href="index.php?id=6">Page 6</a>
    </li>
    <li>
        <a href="index.php?id=7">Page 7</a>
    </li>
    <li>
        <a href="index.php?id=8">Page 8</a>
    </li>
    <li>
        <a href="index.php?id=9">Page 9</a>
    </li>
</ul>

Wanted output, something like this:

<div class="pack">
    <a href="index.php?id=1">Page 1</a>
    <a href="index.php?id=2">Page 2</a>
    <a href="index.php?id=3">Page 3</a>
</div>
<div class="pack">
    <a href="index.php?id=4">Page 4</a>
    <a href="index.php?id=5">Page 5</a>
    <a href="index.php?id=6">Page 6</a>
</div>
<div class="pack">
    <a href="index.php?id=7">Page 7</a>
    <a href="index.php?id=8">Page 8</a>
    <a href="index.php?id=9">Page 9</a>
</div>
<div class="pack">
    <a href="index.php?id=10">Page 10</a>
    <a href="index.php?id=11">Page 11</a>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:08:50+00:00Added an answer on June 17, 2026 at 6:08 pm

    The below typoscript may help you (It’s for page menu to group 3 page links together and you need to modify it according to your requirements.):

    page.234 = COA
    page.234{
    wrap = <ul> |</ul>
    10 = HMENU
    10.1 = TMENU
    10.special = directory
    10.special.value = 1
    10.1 {
    wrap = <li><ul>|</ul></li>
    begin = 1
    maxItems = 3
    NO {
       allWrap = <li> |</li>
    }
    }
    20 < .10
    20.1.begin = 6
    30 < .10
    30.1.begin = 9
    # etc. etc.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to wrap every set of three .item divs in a larger div,
I use this code to wrap every 3 divs in a seprate div and
I am trying to wrap a span around all numbers in a div so
I am trying to wrap a generated series of elements that are created on
Possible Duplicate: Wrap every 3 divs in a div First thing, i know i
I am trying to get a DIV element to wrap its content despite the
Is this good practice to wrap every function with try and catch? I'm building
Im trying to wrap my head around this but am spending too much time
I am trying to wrap my head around this concept. My questions are: Is
I'm trying to wrap a range of children elements in div in order to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.