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 6761249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:09:47+00:00 2026-05-26T14:09:47+00:00

It there any way to apply special formatting for the menu item immediately after

  • 0

It there any way to apply special formatting for the menu item immediately after the current item,
that is CUR + 1. Something like:

lib.menu = HMENU
lib.menu {
    1 = TMENU {
        NO = 1
        NO = {
            ...
        }
        ...
        # The currently selected item
        CUR = 1
        CUR {
            allWrap = ...
        }

        # The next item
        CUR + 1 = 1
        CUR + 1 {
            allWrap = ...
        }
    }
}

I would appreciate any feedback you might have. Also alternatives: Can write a PHP class/function instead of writing this in typoscript.

  • 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-05-26T14:09:48+00:00Added an answer on May 26, 2026 at 2:09 pm

    So I manage to solve this myself. The answers is to use a so-called register to mark if we’ve passed the current object or not. For example:

    lib.menu = HMENU
    lib.menu {
        1 = TMENU {
            NO = 1
            NO = {
                # Render using Common Object Array (COA)
                stdWrap.cObject = COA
                stdWrap.cObject {
                    # Normal Case (However the an item should normally be rendered
                    10 = TEXT
                    10 {
                       if {
                           isTrue.data = register:cid
                           value = NORMAL RENDERING
                       }
                    }
                    20 = TEXT
                    20 {
                       if {
                           isTrue.data = register:data
                           value = RENDERING (IMMEDIATELY) AFTER THE CURRENT ITEM
                       }
                    }
                    # Unset the register (after we've done with our special formatting)
                    30 = LOAD_REGISTER
                    30.cid= 0
                }
            }
            ...
            # The currently selected item
            CUR = 1
            CUR {
                # Render using Common Object Array (COA)
                stdWrap.cObject = COA
                stdWrap.cObject {
                  # However the Current item should normally be rendered
                  10 = TEXT
                  10.field = title
                  # Mark that we've reached the current item
                  20 = LOAD_REGISTER
                  20.cid= 1
                }    
            }     
        }
    }
    

    A register, set using LOAD_REGISTER, is basically a type of run-time variable, which can be set and reset in the course of iterating through the menu items (or whatever). As such it can be used to note our progress through the menu items, particularly noting if we’ve passed the current menu item (CUR) or not.

    rant begin Hardly an elegant solution considering that typoscript is domain-specific language which is mainly used for this normatting stuff like menus./rant end

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way that parent tag styles do not apply to child tag
I would like to know if there is any way I can apply 100%
Is there any way to apply a VCL style to TWebBrowser? I would like
Simple version Is there any way to maintain focus on menu after clicking a
Is there any possible way to apply more than CSS to a control through
Is there any way I can set a formatter on models that will convert
Is there any way to use Google's API to retrieve a user's current zipcode
Is there any way to apply a template to the selected value of a
Is there any way to apply shader effect on particular cell of a Grid.
We can apply only one effect to an element. Is there any way 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.