TYPO3 Filelist: In which way I can set the title / description instead of the filename at TYPO3 7.6.2? - upload

I have a problem using the filelist / upload element of TYPO3 at the current new version 7.6.2. I want to use the title or description part instead of the filename while rendering the list.
I found lots of information on that and in TYPO3 version 6.x it worked with:
tt_content.uploads.20.renderObj = COA
tt_content.uploads.20.renderObj.20.1.data = file:current:title
tt_content.uploads.20.renderObj.30 >
When I insert this lines into the TS of the page where I want to use the filelist it does not work with the new css_styled_content for 7.x.
When I include "CSS Styled Content TYPO3 v6.2 (css_styled_content)" to the setup of the template, the filelist works (but other parts of page not).
Therefore the question: Do you know if there are some changes in rendering the filelist at 7.x?
Thanks for your help
Markus

The reason why you can't change the name => title anymore is that you included Fluid Styled Content ext which is required i.e. for rendering the Text & Media CEtype. It massively overrides the CSS styled content and replaces (almost) whole TS declarations with Fluid templates/layouts/partials from typo3/sysext/fluid_styled_content/Resources/Private folder. I.e.: in typo3/sysext/fluid_styled_content/Resources/Private/Templates/Uploads.html:29 there is {file.name} used which should be more advanced condition...
To change it:
Copy all folders from typo3/sysext/fluid_styled_content/Resources/Private to your custom destination i.e.: fileadmin/fluid_styled_content/Private (this is for avoiding loosing of your changes after system upgrade.
It can be any other path, for an instance you can create your custom ext and put it into typo3conf/ext/yourext/Resources/Private/...
Go to your TypoScript template > Constant Editor > Category: Content and set new paths in these fields:
Path of Fluid Templates... - fileadmin/fluid_styled_content/Private/Templates
Path of Fluid Partials... - fileadmin/fluid_styled_content/Private/Partials
Path of Fluid Layouts... - fileadmin/fluid_styled_content/Private/Layouts
After that go to fileadmin/fluid_styled_content/Private/Templates/Uploads.html:29 and replace the code:
{file.name}
with:
<f:if condition="{file.title}"><f:then>{file.title}</f:then><f:else>{file.name}</f:else></f:if>
As you can see this way you can also change other CEtypes and their typical settings (i.e. add the responsive classes if working with RWD).
On the other hand take a look there are some drawbacks of this solution, i.e. default layouts repeats the <div id="c123">... which is invalid :/
P.S.:
Also just realized that Fluid Styled Content doesn't handle other things, i.e. different layouts for Uploads (that the first thing I saw, didn't check other CEtypes) so you need to consider yourself if it is OK for your project at the moment. I prefer to stay with old way (no need for Text & Media CE) and disable FSC now (I'm pretty sure, that soon it will be nice alternative for CSC, but not now imho :/) To revert typical state you can use these lines mentioned in the GitHub here within your PageTS.

Related

Most efficient way of doing static HTML in multiple languages

So I would need to make static HTML pages in multiple languages and now I'm looking what way it would best to do. HTML of the pages stays same, as does images. Basically only text content changes from localisation to another. Page structure is something like this:
en/
../index.html (main/home page)
../catalogue.html
../video.html
../examples.html
de/
../index.html (main/home page)
../catalogue.html
../video.html
../examples.html
So layout (html, css and images) are same on all pages. Just text content changes. There are about 10 different languages. What tool would you use for the injecting text (from json file?) to each template and automatically building needed folders & files. Grunt + mustache?
This is pretty simple so I don't really want to use any CMS for this. For sass etc I will use Grunt already.
If you are going the grunt way here are some thoughts:
Take a look at grunt-dom-munger, it's designed to manipulate html's using standard selectors. You can replace text, elements, append new ones or remove existing, whatever you need.
If you also need to copy files from here to there after transforming them you may want to use grunt-contrib-copy.
Moreover, do not forget that the Gruntfile is plain javascript so you can write your own custom functions to do whatever manipulations or operations you may need.
Hope this helps you get started...

How do I add more words to the mediawiki UniversalLanguageSelector extension

I have added some contents to the mediawiki sidebar(Mediawiki:Sidebar). When I changed the language from English to Malayalam using the UniversalLanguageSelector, everything in the sidebar except the newly added contents got translated. My question:
What do I do to get all the sidebar contents to be translated to Malayalam?
Can I add those contents along with the translations to some file in the extension's folder so that it also will get translated?
The easiest way to localize the sidebar, is to use system message as variables. E.g., rather than adding the link *mw-mainpage-url|My mainpage in English, *mw-mainpage-url|Min huvudsida in Swedish, etc, just do *mw-mainpage-url|mainpage-description in MediaWiki:Sidebar, and then use mainpage-description/en, mainpage-description/sv, etc to change the translation of that part of the sidebar. This way you only need to change the sidebar layout in one place, and you can make use of the many translations already available, as well as create your own, custom system messages, by adding pages to the MediaWiki namespace.
Note that sidebar contents is aggressively cached. You might need to purge your pages.
Also note that $wgUseDatabaseMessages must be true (default).

How are chapters handled in Typo3 Neos?

I want to use chapters and chapter-menu as a e.g. image gallery, reference module or other collections in Typo3 Neos.
As there are multiple domains with different content in my installation i have a problem with the NodeTypes.yaml:
All my site packages are based on NeosDemoTypo3Org. Because i don't want to have multiple entries "chapter", "chapter menu", "youtube" and so on, i deleted the NodeTypes.yaml in my copies of NeosDemoTypo3Org (which is still installed).
When i add a page with content element "chapter menu" to a package and put some chapters in it, the chapter overview is only displayed, if am putting the NodeTypes.yaml back into my package configuration. But then again i have multiple entries of the same thing.
How/where can i configure this to fit my needs?
That should be no problem. Just having the Chapter etc. in one NodeTypes.yaml is enough for now (until we implemented separation per Site which we want to have at some point). But I guess you adapted all occurances of "TYPO3.NeosDemoTypo3Org" in your TypoScript to match the new package name? You need to of course change that back for everything that is related to those NodeTypes. The TypoScript must point to the correct name for this NodeType. And you have to declare the TypoScript in each package because TypoScript is NOT shared in contrast to the NodeTypes.
What you could do is create a "base package" that contains the NodeTypes and TypoScript (and Tempaltes for those) and include the TypoScript in each of your Site packages.

Typo3 : using typoscript to modify the base-url

I am trying out TYPO3's introduction package. For that I am using Xampp on my computer.
I have installed it in a subdirectory, but since it uses "real-url", I need to modify the generated links, so that instead of http://localhost/about-typo3/ I get http://localhost/subfolder/about-typo3/
I believe it must be done via "typo-script", and from what I have read on the Internet, this line should do the job :
config.baseURL = http://localhost/subfolder/
But I don't know where I should put it. I have tried different locations, but with no apparent effect.
So what I would like to know is : am I on the good path for what I need to do, and if yes, what should I try now ?
This is a bug in the 4.6 Introduction Package. 4.7 will ship with a correct version, so you might just want to go ahead and try the Introduction Package from 4.7RC2 (Preview Releases).
For now, just choose Template in the module menu on the left. Then use the dropdown to select Constant Editor. Now choose the page HOME in the pagetree on the middle.
Now use the second dropdown to select CONFIG. There modify the topmost setting Absolute URI prefix. Input your full domain without the last slash (/). That means copy your current URL from the browser and strip /typo3/backend.php. Now save with the little save icon in the top toolbar.
This will also invalidate all caches for you (because you changed the topmost template). No need to install extra extensions or to do this manually.
Alternative you can fix the actual bug. Go to template module and select the folder TypoScript Templates / page_configuration. Now select Info/Modify instead of Constant Editor and directly above the table page.config. The click the pencil left of Setup. Find the line absRefPrefix = {$config.absRefPrefix}/. This should be around line 62 (4.7RC2). Remove the last slash (/) from that line and save. Because you are not on the topmost template, you need to clear the cache. On the topright of your screen, you can find the yellow flash icon. Click it and select Clear all caches (red flash). Now go to you website again.
A general note about (config.)baseURL. This is more a hack, because it just tells the browser to behave as if the website would be at another place. The correct way is to create correct links in first place. You should use (config.)absRefPrefix instead. To make this work in auto mode, it must be completely empty (config.absRefPrefix =).
Do not use baseURL any more. The next Introduction Package will not have this setting.
Yet another note: If you use the config.absRefPrefix, you have to include the last slash (/). The only reason why you do not have to do so above (in the constants), is because it is hardcoded in the template and thus also preventing the automatic detection to work.
If you are using different hosts, you can use typoscript conditions in your root template:
# Default:
config.baseURL = http://www.example.com/
[globalString = ENV:HTTP_HOST=sub1.example.com]
config.baseURL = http://sub1.example.com/
[global]
[globalString = ENV:HTTP_HOST=sub2.example.com]
config.baseURL = http://sub2.example.com/
[global]
if you are using introduction package. there is Constant for set the base url
Go to 'Template' and 'Constant Editor.. you can find 'Domain name for Base URL [config.domain]' .. for setting base url
also you can put the
config.baseURL = http://localhost/subfolder/
on 'Info Modify' Setup field
hope will help you .. sorry for my bad english

ASP.NET MVC IIS problem

I have this piece of code in a .cs file in an ASP.NET MVC application:
HtmlTableCell r2c1 = new HtmlTableCell();
r2.Cells.Add(r2c1);
r2c1.ColSpan = 2;
r2c1.Style.Add("font", "1px arial");
r2c1.Style.Add("height", "10px");
r2c1.Style.Add("background-image", "url(/Content/Images/pagebgbottomwhite.jpg)");
r2c1.Style.Add("background-repeat", "repeat-x");
This works OK locally, but when I deploy my app using IIS 5 I don't see that picture.
How can I change that format of the URL so I can see it?
First off, you don't really want to have this kind of code in your presenter.
As for URL format, try Server.MapPath("~/Content/Images/pagebgbottomwhite.jpg");. And ensure that this file is indeed where it should be.
You really ought to be using CSS and defining a class that has these attributes. The url would then be relative to the location of the CSS file in the site: url(../Images/pagebgbottomwhite.jpg) -- assuming that your css file is in a sibling directory to Images. Then you would apply the CSS class to your element.
I also agree with Anton that, using MVC, this code should not be in your controllers/models, but rather in the view -- in which case you would not be using HtmlTableCell. In that case, and using pure CSS, it's simply a matter of creating the proper row in the table.
<tr><td class="bottom-row" colspan="2"></td></tr>
Confirm that this file (/Content/Images/pagebgbottomwhite.jpg) is deployed. Is it set not to copy or was it left behind in deployment.

Resources