Wrapping Long URLs that is inside A tag

I wanted to wrap long line/URL in an A tag, we surely did not wish to apply it for the p tag, or any other tag as such.

So the following solution worked well for me, note the “display:inline-block”.

.content p a{
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
display: inline-block;
}

Displaying the actual filename when the same file is uploaded multiple times

Hi!

In Typo3 when we upload the same file (i.e. file with the same name) multiple times in a page, The same name is displayed on the page but the link to the files is diferrent as the file is renamed when it is uploaded.

For example

Say we upload a file name test.txt two times, the file is saved in the uploaded folder as

test.txt

test_01.txt

but on the page it displays as

test.txt (links to test.txt )

test.txt (links to test_01.txt )

So in case for the second time if we want to display the real file name to which it is linked,

i.e. test.txt (links to test_01.txt ) as test_01.txt (links to test_01.txt )

Add the following line in your SETUP CODE

tt_content.uploads.20.linkProc.removePrependedNumbers = 0

This will display the full file name…

Conditional menu based on menu page-id

Following code gives a nice way to have a custom content element as sub-menu item for each main menu item

lib.customMenu = HMENU
lib.customMenu {
 1 = TMENU
 1  {
        wrap = |
        NO.allWrap = | 
        NO.stdWrap.htmlSpecialChars = 1
        NO.after.cObject = COA
        NO.after.cObject {           
            20 = CASE
            20 {
               key.field = uid
               default = RECORDS
               default.tables = tt_content
               default.conf.tt_content < tt_content
               default.conf.tt_content.stdWrap.innerWrap >               
               
               14 < .default               
               14.source = {$submenu_element_14}
               
               15 < .default               
               15.source = {$submenu_element_15}
               
               16 < .default               
               16.source = {$submenu_element_16}
               
               17 < .default               
               17.source = {$submenu_element_17}
               
            }            
            
        }
        ACT = 1
        ACT.after.cObject < .NO.after.cObject
        ACT.allWrap = |
        ACT.ATagParams = class="act"
        ACT.stdWrap.htmlSpecialChars = 1

        CUR < .ACT
        CUR.ATagParams = class="cur"
    }
}

This code cannot be used as it is, you will need to make sure the DHTML/JavaScript code for the sub menu items are configured accordingly.

Further References:

  1. [TYPO3-english] conditional menu based on menu page-id
    http://lists.typo3.org/pipermail/typo3-english/2009-November/065557.html
  2. [TYPO3-english] Custom class in tmenu according to uid page
    http://lists.typo3.org/pipermail/typo3-english/2010-February/067336.html

Display the value one object only when the other object value is faslse

Hello!

In some cases we want to display the value of object only when the value of the other object is false or null. For this to work we use the typoscript cobject with the negate option.

The Following code depicts how to display the PREVIOUS and NEXT buttons in the typoscript prev/next menu. When using the prev/next menu code the prev button does not appear on the first page and next button on the last. But for some purpose we need to have these buttons but without the link.

The following code helps to solve this problem.

lib.prevNext = COA
lib.prevNext{
1 = TEXT
1.value = PREVIOUS
1.stdWrap.if.negate =1
1.stdWrap.if.isTrue.cObject = HMENU
1.stdWrap.if.isTrue.cObject {
special = browse
special {
items = prev
items.prevnextToSection = 1
prev.fields.title = PREVIOUS
}

1 = TMENU
1.NO {
linkWrap = <div class=”button”> | </div>
stdWrap.htmlSpecialChars = 1
}
}

2 = HMENU
2{
special = browse
special {
items = prev|next
items.prevnextToSection = 1
prev.fields.title = PREVIOUS
next.fields.title = NEXT
}

1 = TMENU
1.NO {
linkWrap = <div class=”button”> | </div>
stdWrap.htmlSpecialChars = 1
}
}

3 = TEXT
3.value = NEXT
3.stdWrap.if.negate =1
3.stdWrap.if.isTrue.cObject = HMENU
3.stdWrap.if.isTrue.cObject {
special = browse
special {
items = next
items.prevnextToSection = 1
prev.fields.title = PREVIOUS
}

1 = TMENU
1.NO {
linkWrap = <div class=”button”> | </div>
stdWrap.htmlSpecialChars = 1
}
}
}