wrong content elements in translation of tx_news - typo3

TYPO3 8.7, tx_news 7.2 or 7.3.1.
I use tx_news with attached content elements. In default language all work fine, but when i translate the news article i get a single wrong content element in the list of translated content elements, always on first place.
In steps:
- translating news article
- alle depending content elements are correctly translated
- on first place there is a foreign - translated - content element which does not belong to the news but to a total different page in the tree.
- when i translate the next news article the same content element ist now connected to the new translation - and so on.
- when i click on "Synchronize with default language" the wrong content element is deleted! (Which is wrong and should not happen, of course!)
In the database the wrong content element gets for every translation a new entry in the field "tx_news_related_news. It shuffles from news article to news article ... In the end i get an element which is connected with the news entry which was translated last.
When i delete this content element (or click on "Synchronize with default language" which results in the same) a new false content element is used and begin to shuffle from article to article.
Any ideas what`s going on? Or how to fix it?
Peter

Related

TYPO3 Understanding BE Layout + Template

I am new to TYPO3 and tried out a little bit so far. Now I am stucked or lets say unsure if it's the right way how I would do it.
First I created a simple HTML file and put some CSS to it. When this simple site was finished, I tried a transition to TYPO3 and created some templates + typoscript code. Now I want to work on the content, so I can create this with the integrated editor in TYPO3 and remove it from my templates.
My site would look like this:
Header
News Row (4 Columns)
Another Content Row (3 Columns)
Another Content Row (3 Columns)
Footer
Header and Footer are in partials and don't get any content from the editor. For the news section I would use a plugin. The other content rows have to be filled with content from the TYPO3 editor so my first thoughts are that my backend layout must look like this:
News Row (do I need 4 columns here or just one and let the plugin work?)
left1 center1 right1
left2 center2 right2
Would the backend layout look like this? And for the implementation with typoscript do I have to write all columns in variables e.g. center < styles.content.get... and create all elements in the columns there or can I outsource every variable in one file for example?
Hope you guys understand my problem and can give me some good hints!
About the news row, use just one column and then modify the EXT:news templates to arrange the list of news on four columns;
About the other two rows, you have several options, I think
1) each "cell" is defined in your backend layout, and then yes, you would need a separate colPos for each, something like (in TypoScript):
center < styles.content.get
left < styles.content.get
left.select.where = colPos = 1
2) Same as 1) but you can use the interesting approach used by Benjamin Kott on his sitepackagebuilder . To make it short, he defines a "dynamicContent" TypoScript object that can accept as parameters the colPos and even the id of a specific page. You just write in yout Fluid Template:
<f:cObject typoscriptObjectPath="lib.dynamicContent" data="{colPos: '0'}" />
And so forth for the others. If you want to discover more, visit https://www.sitepackagebuilder.com/ and create a package (that you could use as a base for your development or just "pillage" it ;) ) You will also find several videos on this topic on the Youtube TYPO3 official channel
3) same as 1) but using the EXT:vhs that adds a specific viewhelper to render the content of a colPos:
<v:content.render column="0" />
4) Last but not the least you can use EXT:gridelements to build content element that can have other content elements as children with a "backend_layout" approach. In this approach you just need one "cell" in your backend layout, and in this cell you will put a "gridelement" CE that is sub-divided into three separate columns and in each one you can put one or more content elements (same for the third row). This approach will give you the maximum flexibility
I hope I made myself clear, if I misunderstood your question, don't hesitate to write :)

Localization do not work when "l18parent" is empty (0)

When a content element is translated using "translate" method and so have a l18parent, the content shows up in frontend.
When using "copy" method or created the content in new language without l18parent the content do not appear in frontend.
Can simply test it when unselecting a l18parent in CE form and selecting a parent again.
See screenshots attached.
With parent, working.
Without parent, not working (not appearing in frontend).
Not working
Working
Since TYPO3 6.2 there is a new setting for the CONTENT object: includeRecordsWithoutDefaultTranslation
see here: https://docs.typo3.org/typo3cms/TyposcriptReference/6.2/Functions/Select/
Before this, the CONTENT object fetched all elements.
After this change, only elements which were correctly translated in the backend with the translation buttons, are displayed, because they have a parent.
Maybe you can check with these settings in your typoscript (at the beginning of your typoscript):
styles.content.get.select.includeRecordsWithoutDefaultTranslation = 1
styles.content.getLeft.select.includeRecordsWithoutDefaultTranslation = 1
styles.content.getRight.select.includeRecordsWithoutDefaultTranslation = 1
Then all elements should show up again; even the ones without parent.
Original resource for this is written in german here:
http://blog.teamgeist-medien.de/2014/08/typo3-content-anzeige-von-uebersetzungen-ohne-parent-bzw-default-translation.html

TYPO3 meta description - Use closest

I have set the description meta using:
page.meta.description.field = description
Can I make it so child pages use the description from the closest page that has one set?
So if the root page has description1 then all sub-pages use it, unless a sub-page has it's own description2 in which case it and any sub-pages of it would use description2 and so on...
two parts:
in your typoscript:
page.meta.description.data = levelfield:-1, description, slide
in your Install-Tool add the field to the fields which should slide:
$GLOBALS['TYPO3_CONV_VARS']['FE']['addRootLineFields'] = 'description';
added:
aside from straight slide to first non empty entry, you also have options to collect all the entries along the rootpath:
.slide If set and no content element is found by the select command, the rootLine will be traversed back until some content is found.
Possible values are "-1" (slide back up to the siteroot), "1" (only the current level) and "2" (up from one level back). Use -1 in combination with collect:
.slide.collect: (integer /stdWrap) If set, all content elements found on the current and parent pages will be collected. Otherwise, the sliding would stop after the first hit. Set this value to the amount of levels to collect on, or use "-1" to collect up to the siteroot.
.slide.collectFuzzy: (boolean /stdWrap) Only useful in collect mode. If no content elements have been found for the specified depth in collect mode, traverse further until at least one match has occurred.
.slide.collectReverse: (boolean /stdWrap) Reverse order of elements in collect mode. If set, elements of the current page will be at the bottom.
You should not do this - you will get a bunch of error messages in the google webmaster tool complaining about duplicate meta tags. Google dont like this ... it is a kind of duplicate content.
Watch this video from google evangalist Matt Cutts: http://searchengineland.com/googles-matt-cutts-dont-duplicate-your-meta-descriptions-177706
"In short, it is better to let Google auto-create snippets for your pages versus having duplicate meta descriptions."

How to fusion two content elements? / Does an all in one content element exist?

I need a content element that cointains apsects from the "Textpic" and the "Media" content elements.
Basically I need the whole palette of input masks of the textpic CE (headline, rte text, images) plus the media tab (swf, mp4, mov) from the media content element.
This special requirements for our project comes from the need that we can only use one content element for our specific javascript content slieder. So I can not use like a Textpic and underneath a media CE. No it really has to be just one CE which can handle the textpic + the media CE stuff.
Generally I ask you: Is there already a extension, trick, modification or a framework which I can/should be use to achive that i can "fusionate" content elements? Like an "all-in-one"-content element, a multi content element?
Ps: I do not use Templavoila. My Typo3 version is 4.5
I think this is the tutorial you're looking for:
http://castironcoding.com/resources/our-blog/sp/view/single/post/reason-6-for-choosing-typo3-custom-content-elements-and-extbase-again-part-23.html
Follow step 2 and 3.
You'll also need to add a specific rendering config in Typoscript ie: tt_content._your-ce_
But it can be copied from out of tt_content.textpic and tt_content.media. You can find the expample typoscript of before mentioned CE's in: typo3/sysext/css_styled_content/static/setup.txt. Just don't alter it there, but make a copy and alter in your own file.
As you seem to only talk about reusing already exisiting fields, you really only need to change the backend interface (big keyword: "showitem"). You'll need the database names of the fields (peek into the tt_content table of some records where you know the contents), alternatively visit the module Admin Tools / Configuration, select TCA in top dropdown menu, open tt_content and columns.
Try http://blog.chandanweb.com/typo3/adding-new-fields-to-existing-typo3-tables-at-desired-location, you'll of course have to substitue tt_content for tt_news etc.
You might also want to make a new type (the above recipe is for changing a preexisitent), but I'm sorry, I'm currently out of time for explaining that. It's not very hard, though, and the castiron link by Koopa will help you on your way.
Perhaps you can wrap the content column in another div? You can use that outer div for your content slider. Now you actually use all content elements seperately, but combine then for usage.

Customizing single entry templates in ExpressionEngine (1.6.x)

This is either very annoying or very embarrassing. I've set up most of my blog, but I can't figure out where or how the heck I set up single entry templates as opposed to the section/weblog containing them. I just can't find information on how to do it for the life of me.
This is especially important, because I want to define the canonical link for all entries, since ExpressionEngine links to entries in all kinds of ways.
So, the case is that I have a Blog section/weblog with an index working as the front page for mydomain.com. This lists all my entries as you would imagine a regular blog to do. The problem arises when I need to customize the code for the single entries' links.
If you have a template set up already which is showing a multitude of entries and you want a single entry page for each entry then what you need to do is this :
{exp:channel:entries
channel="default_site"
sort="asc"
disable="member_data|pagination|categories"}
{title}
{/exp:channel:entries}
Then in the template shown above by template_group/template_name (please change those to whatever your template group and template names actually are ;-) ) you will place this code :
{exp:channel:entries
channel="default_site"
limit="1"
dynamic="yes"
sort="asc"
disable="member_data|pagination|categories"}
{title}
{/exp:channel:entries}
This will then show you just the one entry as you will have used the {url_title_path="template_group/template_name"} in the first channel entries tag above which would basically create a URI something like this :
http://www.example.com/template_group/template_name/url_title_of_my_posted_entry
On the second (template_group/template_name) single entry template page it will see the URL title and use this to filter down the channel entries tag to just that one entry.
Hope that helps a bit.
Best wishes,