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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:06:43+00:00 2026-05-27T11:06:43+00:00

It would be very convenient in the case of end-user controlled layout options. E.g:

  • 0

It would be very convenient in the case of end-user controlled layout options. E.g:

<div class="ImageContainer  <<PositionClass>>">
    <img src="/someimage.png" />
</div> 

The position class (like maybe Left, Right, Background) would be set the user by selecting a layout option from a drop down in content element. The problem is, that if you map such an option to the class attribute of the container div, the base class(named ImageContainer in the above example) will be overwritten.
Is it possible to append a value to an existing attribute rather that overwriting it completely?

I’ve seen work-around where the end-user controlled layout option is mapped to the name attribute in stead, but i find this inelegant.

  • 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-27T11:06:44+00:00Added an answer on May 27, 2026 at 11:06 am

    Create your composed class names in TypoScript. This way you are able to compile them from fixed and variable parts and you can even take multiple FCE fields into account.

    Here is an example:

    DS XML

      <field_imagepos type="array">                                                                     
        <type>no_map</type>                                                                                
        <tx_templavoila type="array">                                                                      
          <title>Image Positioning</title>                                                    
          <sample_data type="array">                                                                       
            <numIndex index="0"></numIndex>                                                                
          </sample_data>                                                                                   
          <eType>select</eType>                                                                            
        </tx_templavoila>                                                                                  
        <TCEforms type="array">                                                                            
          <config type="array">                                                                            
            <type>select</type>                                                                            
            <items type="array">                                                                           
              <numIndex index="0" type="array">                                                            
                <numIndex index="0">Left</numIndex>                                                        
                <numIndex index="1">Left</numIndex>                                                        
              </numIndex>                                                                                  
              <numIndex index="1" type="array">                                                            
                <numIndex index="0">Right</numIndex>                                                       
                <numIndex index="1">Right</numIndex>                                                       
              </numIndex>                                                                                  
              <numIndex index="2" type="array">                                                            
                <numIndex index="0">Background</numIndex>                                                       
                <numIndex index="1">Background</numIndex>                                                       
              </numIndex>                                                                                  
            </items>                                                                                       
            <default>Left</default>                                                                       
          </config>                                                                                        
          <label>Image Positioning</label>                                                    
        </TCEforms>                                                                                        
      </field_imagepos>                                                                                 
    
      <field_calc_class type="array">                                                                      
        <type>attr</type>                                                                                  
        <tx_templavoila type="array">                                                                      
          <title>(Calculating the class attribute)</title>                                                 
          <description>Pick ATTR class='ImageContainer ...'</description>                              
          <sample_data type="array">                                                                       
            <numIndex index="0"></numIndex>                                                                
          </sample_data>                                                                                   
          <eType>TypoScriptObject</eType>                                                                  
          <tags>div:attr:class</tags>                                                                      
          <TypoScriptObjPath>lib.calcClass</TypoScriptObjPath>                                        
        </tx_templavoila>                                                                                  
      </field_calc_class> 
    

    TypoScript

    lib.calcClass = TEXT
    lib.calcClass{
      dataWrap = ImageContainer {field:field_imagepos}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While it would be very convenient to use inline functions at some situations, Are
I thought this would be very easy. I downloaded the JDK, extracted src.zip, modified
I am in a situation where it would be very convenient to find the
Would very much appreciate any help or hint on were to go next. I'm
have small problem, and would very much appreciate help :) I should convert byte
I've recently begun working on a very large, high traffic website. We would very
I'm writing a complex setup/installer application in native C++/MFC. I would very much like
This would be very handy as typecasting gets boring fast.
It would be very useful to be able to overload the . operator in
It would be very beneficial to me to be able to monitor my app

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.