Today I have done one typo3 upgrade from 4.5 to 6.2. Initially from 4.5 to 4.7 everything was working fine with out any issues. After upgrading TYPO3 6.2 content elements like textimage and image only are not rendering . Can any one please tell me why this is happening? The below given typoscript is used to rendering banner images in the website. Can any one give me a hint?
#####################
### lib.keyVisual #
#####################
lib.keyVisual = COA
lib.keyVisual {
5 = LOAD_REGISTER
5.maxImageWidth = 960
5.maxImageWidthInText = 960
50 = RECORDS
50.source.current = 1
50.tables = tt_content
# remove all divs from textpic rendering
50.conf.tt_content.stdWrap.innerWrap.cObject.default.15.value = item
50.conf.tt_content.textpic.20.layout >
50.conf.tt_content.textpic.20.layout = TEXT
50.conf.tt_content.textpic.20.layout.value = ###IMAGES######TEXT###
50.conf.tt_content.textpic.20.imageStdWrap.dataWrap =
50.conf.tt_content.textpic.20.imageStdWrapNoWidth.dataWrap =
50.conf.tt_content.textpic.20.imageColumnStdWrap.dataWrap =
50.conf.tt_content.textpic.20.rendering.simple.imageStdWrapNoWidth.dataWrap =
50.conf.tt_content.textpic.20.rendering.simple.imageStdWrap.dataWrap =
50.conf.tt_content.textpic.20.rendering.simple.imageStdWrapNoWidth.wrap =
50.conf.tt_content.textpic.20.rendering.dl.imageStdWrapNoWidth.dataWrap =
50.conf.tt_content.textpic.20.rendering.dl.imageStdWrap.dataWrap =
50.conf.tt_content.textpic.20.rendering.dl.imageStdWrapNoWidth.wrap =
50.conf.tt_content.textpic.20.text.wrap.cObject = CASE
50.conf.tt_content.textpic.20.text.wrap.cObject {
key.field = imageorient
key.stdWrap.wrap = |+1
key.prioriCalc = 1
1 = TEXT
1.value = <div class="item-position1"> | </div>
2 = TEXT
2.value = <div class="item-position2"> | </div>
9 = TEXT
9.value = <div class="item-position3"> | </div>
4 = TEXT
4.value = <div class="item-position4"> | </div>
default = TEXT
default.value = <div class="item-position-default item-position-{field:imageorient}"> | </div>
default.insertData = 1
}
100 = RESTORE_REGISTER
wrap.required = 1
wrap (
<div id="page-hero" class="page-hero">
<div class="slides_container">
|
</div>
<a class="prev" href="#"></a>
<a class="next" href="#"></a>
</div>
)
}
BR
Siva
It's probably the function IMAGE($conf) that fails to render it. You can debug it in typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
If it's not that exact one it might be IMGTEXT or a similar one.
After an upgrade from TYPO3 4.x to 6.2 you must perform several steps to get the images back.
Install Tool - Configuration presets: Image handling settings -> Use the detected (marked green) Image Magick or Graphics Magick
Install Tool - Test Setup and make some of the image tests
Install Tool - Clean Up: cache_imagesizes
Install Tool - Clean Up: Clear processed files
TYPO3 Backend - File Module: Click on the Filelist. This will load all images found there into the File Abstraction Layer (FAL)
Related
I am trying to get some acsii art characters directly from a webpage. You can navigate to the page using the following URL.
http://patorjk.com/software/taag/#p=display&f=Acrobatic&t=A
If you go to that page you will see a rendering of the character A using the Acrobatic font.
o
<|>
/ \
o/ \o
<|__ __|>
/ \
o/ \o
/v v\
/> <\
Using the following code nets me most of the page.
$fontUrlTemplate = "http://patorjk.com/software/taag/#p=display&f={0}&t={1}"
$fontName = [uri]::EscapeUriString("Acrobatic")
$character = "A"
$fontUrl = $fontUrlTemplate -f $fontName, $character
$webResult = Invoke-WebRequest $fontUrl
$webResult.Content
However when I inspect the Content the actual result I am looking for is missing.
...
<div id="maincontent" >
<div id="outputFigDisplay" ></div>
</div>
...
There should be something like this in there
<pre id="taag_output_text" style="float:left;" class="fig" contenteditable="true">...</pre>
I am sure there is a server side reason for this but I would like to better understand and, if possible, mitigate it. I have tried mucking around with -ContentType and -UserAgent but it didn't change anything
I'm working with the sitepackage by Ben Kott for Typo3 9.5 and include content into my fluid template like this:
<f:cObject typoscriptObjectPath="lib.dynamicContent" data="{colPos: '1'}" />
I'm tryin to wrap this into a condition withing fluid like
<f:if condition="<f:cObject typoscriptObjectPath='lib.dynamicContent' data='{colPos: \'1\'}'">
whatever
</f:if>
it does not work though. I can not tell if there's anything wrong syntax or if it's not possible.
{f:cObject(typoscriptObjectPath: 'lib.dynamicContent', data: {colPos: 1}) -> f:variable(name: 'content')}
<f:if condition="{content}">
There is content. Here it is:
{content -> f:format.raw()}
</f:if>
Avoids double rendering of the typoscript object, double DB requests etc.
Avoids tag syntax inside tag attributes which is probably going to be impossible to do in future Fluid versions
Edit for posterity: the exact reason why the code above failed seems to be a syntax error:
<f:if condition="<f:cObject typoscriptObjectPath='lib.dynamicContent' data='{colPos: \'1\'}'">
Should be:
<f:if condition="<f:cObject typoscriptObjectPath='lib.dynamicContent' data='{colPos: \'1\'}' />">
Since the inner tag was not closed. You should still avoid it though - use inline syntax instead. In the code I put above you can remove the -> f:variable() part and the expression can then be used as tag attribute value.
Another solution would be a dedicated TypoScript object which you can use in Fluid if conditions
################################################
#### COUNT CONTENT LIB FOR USAGE IN FLUID ####
################################################
#
# EXAMPLE: amount of content elements in colPos 1 of actual PID
# ---------------
# <f:cObject typoscriptObjectPath="lib.countContent" data="{colPos: 1}" />
# {f:cObject(typoscriptObjectPath: 'lib.countContent', data: '{colPos: 1}')}
#
# EXAMPLE: amount of content elements in more than one colPos of actual PID
# ---------------
# <f:cObject typoscriptObjectPath="lib.countContent" data="{colPos: '1,2'}" />
# {f:cObject(typoscriptObjectPath: 'lib.countContent', data: '{colPos: \'1,2\'}')}
#
#
#
#
# Usage examples:
# --------------
#
# <f:if condition="{f:cObject(typoscriptObjectPath: 'lib.countContent', data: '{colPos: 1}')}">
# <f:cObject typoscriptObjectPath="lib.dynamicContent" data="{pageUid: '{data.uid}', colPos: '1', wrap: '<aside class=\"l-aside\">|</aside>'}" />
# </f:if>
#
#
# <f:if condition="{f:cObject(typoscriptObjectPath: 'lib.countContent', data: '{colPos: 1}')}">
# <aside class="l-aside">
# <f:cObject typoscriptObjectPath="lib.dynamicContent" data="{colPos: '1'}" />
# </aside>
# </f:if>
#
#
###############
lib.countContent = COA
lib.countContent {
5 = LOAD_REGISTER
5 {
colPos.cObject = TEXT
colPos.cObject {
field = colPos
ifEmpty.cObject = TEXT
ifEmpty.cObject {
value.current = 1
ifEmpty = 0
}
}
pageUid.cObject = TEXT
pageUid.cObject {
field = pageUid
ifEmpty.data = TSFE:id
}
contentFromPid.cObject = TEXT
contentFromPid.cObject {
data = DB:pages:{register:pageUid}:content_from_pid
data.insertData = 1
}
}
20 = CONTENT
20 {
table = tt_content
select {
selectFields = count(uid) AS counter
where = {#colPos} IN({register:colPos})
where.insertData = 1
pidInList.data = register:pageUid
pidInList.override.data = register:contentFromPid
andWhere = (deleted = 0 AND hidden = 0)
}
renderObj = COA
renderObj {
10 = TEXT
10 {
data = field:counter
}
}
}
90 = RESTORE_REGISTER
}
This snippet is tested and used in TYPO3 8.7 LTS without workspaces
I have this typoscript to request content only (without the header, css, js, etc)
ajaxCall = PAGE
ajaxCall {
typeNum = 999
config.disableAllHeaderCode = 1
config.disablePrefixComment = true
# config.additionalHeaders = Content-type: text/html; charset=utf-8
config.metaCharset = UTF-8
10 = COA
10 < styles.content.get
10.stdWrap.prepend > # supress feEditAdvanced-firstWrapper - Bug in typo3 4.3.1
}
This works fine as long as I am in the default language. But when I want to use this pageType on another language &L=1 it does not work and I get nothing.
I tested around a bit and found out that the problem is here
10 = COA
10 < styles.content.get
It looks like when there is a language parameter the styles.content.get is empty.
Edit: I try to get the content with my own CONTENT object
ajaxCallw = PAGE
ajaxCallw {
typeNum = 1000
config.disableAllHeaderCode = 1
config.disablePrefixComment = true
# config.additionalHeaders = Content-type: text/html; charset=utf-8
config.metaCharset = UTF-8
10 = CONTENT
10 {
table = tt_content
select.orderBy = sorting
select.where = colPos=0
select.languageField = 4
}
}
It looks like select.languageField = 4 gets completly ignored, as it still displays me the content from the default langauge. And when I call a URL with &type=1000&L=4 it still does not show me anything. (Without the L=4 parameter it shows me the default language content)
select.languageField is a pointer to the field in the database
select.languageField = sys_language_uid
As far as I remember the language variable is not parsed by default, so you have to set it yourself
ajaxCall {
# your code
config.sys_language_uid = 0
}
# condition for the language. Adjust it to your language id
[globalVar = GP:L = 1]
ajaxCall.config.sys_language_uid = 1
[global]
The sys_language_overlay = hideNonTranslated was the problem.
Adding: ajaxCall.config.sys_language_overlay = 0 solved the problem.
ajaxCall = PAGE
ajaxCall {
typeNum = 999
config.disableAllHeaderCode = 1
config.disablePrefixComment = true
# config.additionalHeaders = Content-type: text/html; charset=utf-8
config.metaCharset = UTF-8
config.sys_language_overlay = 0
10 = COA
10 < styles.content.get
10.stdWrap.prepend > # supress feEditAdvanced-firstWrapper - Bug in typo3 4.3.1
}
I am not sure why exactly this works now..
styles.content.get is just a CONTENT object that gets the content of col0 (rendered true or with css_styled_content) you can better just fetch your content with your own CONTENT object, thus you can have more control of it.
Hi I like to add some additional menu items to a defined mainmenu.
Here is my attempt:
[PIDinRootline = 18]
lib.mainmenu.1 {
ACT = 1
ACT{
after.cObject = HMENU
after.cObject < lib.catmenu
}
}
[END]
well working so far, but the menu items are only showing up when the page 18 is active. I'd like them to be allways visible.
Any Idea?
further information:
my menus
lib.catmenu = HMENU
lib.catmenu{
1 = TMENU
1 {
wrap = <div class="megamenu-dropdown"><ul class="level0"> | </ul></div>
expAll = 1
noBlur = 1
NO = 1
NO.wrapItemAndSub = <li class="level1 nav-1-1 default"> | </li>
ACT = 1
ACT.wrapItemAndSub = <li class="level1 nav-1-1 active"> | </li>
}
}
lib.mainmenu = HMENU
lib.mainmenu{
entryLevel = 0
1 = TMENU
1{
expAll = 1
wrap = <ul id="nav"> | </ul>
noBlur = 1
NO = 1
NO {
wrapItemAndSub = <li class="level0 nav-1 level-top default"> | </li>
stdWrap.htmlSpecialChars = 1
ATagTitle.field = title
}
IFSUB = 1
IFSUB{
wrapItemAndSub = <li class="level0 nav-1 level-top default parent"> | </li>
stdWrap.htmlSpecialChars = 1
ATagTitle.field = title
}
ACT = 1
ACT{
wrapItemAndSub = <li class="level0 nav-1 level-top default active"> | </li>
}
}
edit:
Thanks for the responses.
I try to make my question more understandable.
This is how my menu usually looks like
- home
- shop
- news
- test
- subtest
This is how my menu looks like when I open the page with id 18
- home
- shop
- cat1
- cat2
- news
- test
- subtest
This is how I want my menu allways looks like
- home
- shop
- cat1
- cat2
- news
- test
- subtest
When I remove the condition [PIDinRoorline = 18] then typo3 has no Idea where to add the additional menu Items. The result is: (I've also changed ACT to NO)
- home
- cat1
- cat2
- shop
- cat1
- cat2
- news
- cat1
- cat2
- test
- subtest
So is there any way to say typoscript. "Put my additional menu Items to a specific place"
Thanks for your help!
Cheers
This is a condition that makes sure that the configuration inside is only taken into account on page 18. Just remove this condition and the configuration will apply.
[PIDinRootline = 18]
...
[END]
I'd like to escape a HTML in my template, but no matter what I try it won't work
Here is my template:
<ul>
#for(index <- 0 until appointments.size){
<li>
#(utils.DateUtil.getLocalDate(appointments(index).getStartDate())) - #appointments(index).getReason()
<ul>
#{val procedure = appointments(index).getProcedures()
{if(procedure == null){
<b>Empty</b>
} else {
">b/<NotEmpty>/b<" +
procedure.size().toString+
procedure.size().toString+
<b>NotEmpty</b>+
"<b>NotEmpty</b>"+
"<b>NotEmpty</b>".toString;
}
}
}
</ul>
</li>
}
</ul>
The problematic code is in the else branch
I'm trying to print <b>NotEmpty</b> as NotEmpty but I've got just a plaintext, not html
I've tried #Html("<strong>Do not escape</strong>") but it says expected start of definition
if I delete the else branch contents and leave just
else {
<b>NotEmpty</b>;
}
It prints out fine.
I'm using play framework 2.2.1 built with Scala 2.10.2 (running Java 1.7.0_25)
How about:
#{
val x = Some(Seq("hi there"))
if(x.isDefined)
<b>size = {x.get.size}</b><br/>
<b>Not Empty</b>
else
<b>Empty</b>
}