TYPO3 CMS : tx_news : How can I change the labels in List View? - translate

--
Hello!
I use TYPO3 CMS 6.2.9 and the Versatile News System (tx_news).
For my User (Editor), I'll only allow to add new news records in my specific sys-folder. Here's my pageTSconfig for the sys-folder:
### only for EDITORS usergroup 2
[usergroup = 2]
# only show "new news and news tag" for a new data record
mod.web_list {
allowedNewTables = tx_news_domain_model_news, tx_news_domain_model_tag
}
[GLOBAL]
It works.
But how can I translate the labels, for example in german: "Artikel" and "Nachrichten-Tag" in List-View for my Editor. I can't find these strings in Ext. news folder (typo3config/ext/news). In this case, I'll use tx_news not for NEWS, so it won't confuse my backend-user (editor) ;)
I#m talking about this List View:
I can translate all other labels via TCEFORM
TCEFORM.tx_news_domain_model_news.title.label.de = Überschrift
but not the labels at list view.
Thanks for your help.

These labels are configured in TCA for given table and only way to override it is changing it's value i.e. by adding this line to typo3conf/extTables.php
$TCA['tx_news_domain_model_news']['ctrl']['title'] = 'Change me...';
Problem with this is you can't do it conditionally by default, maybe this EXT will help you (as mentioned on some forum it's not maintained anymore)
http://docs.typo3.org/typo3cms/extensions/tcamanipulate/
How to find it: Every table has its TCA (required) so you can find it with editor, or using SYSTEM > Configuration module to browse currently loaded TCA.

Related

Typo3 FAL show file browser popup in backend module

I have a site which shows a teaser (image+text) on all pages.
This should be editable from admin, so I created a small backend module (a simple form) where the admin should set the image and the text and save them in Typo3's registry db table:
This is how I save the text:
$request = $this->controllerContext->getRequest();
$arguments = $request->getArguments();
$registry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( 't3lib_Registry' );
$extKey = $request->getControllerExtensionKey();
$registry->set( $extKey, 'text', $arguments['settings']['text'] );
but I don't know how to add an "Add image" link to display the file browser and get the url/id of the selected file.
Any ideas?
Thanks.
In order to have a file picker you will need to have a TCA for a FAL field. A TCA is usually connected to a table and I wouldn't know of any implementation with the registry as a "storage backend".
This means you would have to create TCEForms yourself and then intercept the saving process. This is possible but rarely used and rather complicated, see an example here:
https://git.typo3.org/Packages/TYPO3.CMS.git/blob/TYPO3_4-5:/typo3/sysext/version/ws/workspaceforms.php
(for TYPO3 4.x, for 6.x the class names have to be adjusted)
So I would suggest that you extend the table pages with a field for text and a FAL field instead of trying to write an own backend module for this purpose.

Building a list of downloadable items in Orchard 1.6

I'm fairly new to Orchard and I'm wondering about the "best" way of building a basic list of documents with a download link?
Say the scenario is this, I want to make a list of newsletters, the news letter are in PDF format and the users should be able to download then straight from the list view.
An admin, should easily be able to add a new newsletter and it should turn up in the list.
My current train of thought is to, all through the dashboard,
create a content type "Newsletter" with a title field and a Media picker field, using the media picker field to upload the PDF file.
Then create a query, with the filter on Content type "Newsletter"
Create a projection pointing to the query
However, this only gives me a list of content items, showing their title as links back to the actual content item.
I've tried adding a layout to the query and set it to display properties instead of content. By doing that I can get a list where I can control the "output" a bit more. And I've gotten it to list the title and by doing a Rewrite and putting in the MediaPicker.Url, it also displays the URL in the list. This is all good but here I get stuck..
As the MediaPicker.URL outputs the url in the format like ~/media/default/xyz/filename.pdf, I cant just put it into a a href, it doesn't give a correct download link to the file.
Soo, question is, am I thinking and doing this totally the wrong way or am I missing something obvious? All ideas and suggestions and more then welcome.
Use or adapt the following template override in your theme:
#{
var url = Model.ContentField.Url;
}
#if(Model.ContentField.Url != null) {
if (url.StartsWith("~/")) {
url = Href(url);
}
<div class="media-picker-field attachment-pdf">
<span>download</span>
</div>
}
Modify the text as needed. This template was a Fields.MediaPicker-PDF.cshtml that was used for a media picker field named PDF.

Orchard CMS create theme view for my content type

I am using orchard cms with the bootstrap theme.
I have created a content type: House
it contains FIELDS
image (media picker field)
Property Type (taxonomy field)
Location (taxonomy field)
It has PARTS
common
body
publish later
Title
Autoroute
I want queries of houses and be able to choose the view/ layout for them
e.g. layout called HouseList (for sidebars mainly) which will render: title, image and link to house, possible location and type but with out the links as defaulted. And then a fullDetails layout and a image only layout (so i can show a jquery image reel a widget say in a quadzone) How can i do all this please, i have tried in view Content-House.cshtml etc but i cant access the details model.content to choose what to display.
Im sure when i get the idea of how to do 1 i should be able to sort the rest. I have read documentation etc but there are so many different ways, ie placement file, change the parts, contents, create classes to handle display etc. sureley i am missing something simple like create a view for each list i want eg. houue-list, house-details, house-imageONly and then manipulate content.
Please help i have been trying different things for getting this site running for weeks and not getting very far. Examples would be fantastic but i have searched google for hours and found similar but nothing with enough details for a meer beginer.
Thanks
The standard way of doing that is placement to move things around and alternate templates for the different parts and fields. You can specialize placement and alternates with the display type, which is Summary when rendering in a list such as what a projection returns, and Detail for the detail view. More info on placement can be found here: http://docs.orchardproject.net/Documentation/Understanding-placement-info and on alternates here: http://docs.orchardproject.net/Documentation/Alternates
Now if you prefer to completely take over the rendering and do without placement, here are a few posts that may help:
http://weblogs.asp.net/bleroy/archive/2011/07/31/so-you-don-t-want-to-use-placement-info.aspx
http://weblogs.asp.net/bleroy/archive/2011/03/27/taking-over-list-rendering-in-orchard.aspx

How does one correctly set the target page of indexed search results in typo3?

I am working with typo3 4.7 and trying to redirect the search results of the indexed search plugin to a page in my site and managed to stumble upon the constants editor where I've managed to use it to guide me in setting up the object. Below is the current typoscript of the object in my root template (mapped into a TV template):
# --- SEARCHBOX OBJECT ----------------------------------
lib.searchbox < plugin.tx_indexedsearch
lib.searchbox{
#Disable the advanced search link
show.advancedSearchLink = 0
show.rules = 0
show.alwaysShowPageLinks = 1
#pid of root page is 1 and pid of the search result page is 9
search.rootPidList = 1
search.targetPid = 1
view.defaultPid = 9
result_link_target = 9
}
Thus far I have been unsuccessful in my attempts and all results are displayed in the page in where the search was performed. I would also like to know if it is possible to modify the displayed search box so that only the search field is displayed.
Thanks for your time.
Edit: I have installed and I'm trying out solr, if anyone has any experience with it pls feel free to help resolve this issue. My two problems with solr so far is that whilst search does re-direct to the right page, (1) the search box is way too big so I need to be able to modify the display of this box (to remove the button and reduce the size) (2) it spouts som e messages about search rules and returns nothing so far.
Edit 2: Seems solr is the way forward. I have managed to get everything I want done except the result output. I lost a few days (5) before realising that the tomcat container was bound to an ipv6 protocol interface. Resolving that (see here for those who may stumble upon the same problem for how to resolve this) has meant I can now remotely admin the solr server for more information. The pages are being indexed (Not regularly as specified in the scheduler) but I still get no results on the result page, and devlog only returns warning about there not being typo3 search markers despite my TV templates being peppered with them. I can only guess that maybe I'm to mark the results page with some type of marker to get the results to show at this point.
plugin.tx_indexedsearch {
search {
targetPid >
targetPid = 123
}
}
Reference: http://lists.typo3.org/pipermail/typo3-team-core/2010-March/036269.html
Experience: works even in TYPO3 version 6.x.
Default setting for plugin.tx_indexedsearch.search.targetPid is:
plugin.tx_indexedsearch {
search {
# TSFE:id is always the current page
targetPid.data = TSFE:id
}
}
I have never used the indexedsearch plugin as the searchbox on all of my pages.
Normally, I do this
Create a page with the indexed_search plugin as its content, this is
where all search requests are answered
Use macina_searchbox to
display a search box as part of the template
To elaborate:
Install macina_searchbox, and use this Typoscript to configure it
plugin.tx_macinasearchbox_pi1 {
pidSearchpage = {PID_OF_SEARCH_RESULT_PAGE}
templateFile = {PATH_TO_TEMPLATE_FILE_FOR_SEARCH_BOX}
}
Then, include macina_searchbox like so
lib.searchbox < plugin.tx_macinasearchbox_pi1
The search result page just needs the indexed_search plugin where you want the results to be displayed.
I would just create a search box, copy the HTML-Code, adjust action-url and HTML-Code and output it. IMHO there is no need, to render it via Plugin, if you just need an search-input field and an button. But do not forget the hidden fields!

Change Edit Control Block (ECB) Link URL in SharePoint

Is there a way to dynamically change the hyperlink associated with an ECB menu in WSS 3.0? For instance, I have a list with 2 fields. One field is hidden and is a link, the other is the title field which has the ECB menu. The title field currently links to the item's view page - but we want it to link to the link-field's url. Is that possible?
UPDATE - 5/29/09 9AM
I have this so far. See this TechNet post.
<script type="text/javascript">
var url = 'GoTo.aspx?ListTitle='+ctx.ListTitle;
url += '&ListName='+ctx.listName;
url += '&ListTemplate='+ctx.listTemplate;
url += '&listBaseType='+ctx.listBaseType;
url += '&view='+ctx.view;
url += '&';
var a = document.getElementsByTagName('a');
for(i=0;i<=a.length -1;i++)
{
a[i].href=a[i].href.replace('DispForm.aspx?',url);
}
</script>
This gives me a link like so (formatted so it's easier to see):
GoTo.aspx
?ListTitle=MyList
&ListName={082BB11C-1941-4906-AAE9-5F2EBFBF052B}
&ListTemplate=100
&listBaseType=0
&view={9ABE2B07-2B47-4390-9969-258F00E0812C}
&ID=1
My issue now is that the row in the grid gives each item the ID property above but if I change the view or do any filtering you can see that the ID is really just the row number. Can I get the actual item's GUID here?
If I can get the item's ID I can send it with the list ID to an application page that will get the right URL from field in the list and forward the user on to the right site.
I think the easiest solution and one I use regularly to modify default sharepoint functionality without having to install server side code is to inject some javascript onto the page to make the necessary modifications.
The Content Editor webpart is ideal for this if you don't want to edit the page source itself. Together with the IE Developer Toolbar or Firebug to inspect the elements you want to edit you should be able to achieve what you need with just a couple of lines of javascript.
Let me know if you need any further detail on getting this work.
The title/link to edit menu is a computed field - basically a combination of the title and item id. If you look at the definition of the field (off the top of my head I think it's in fields.xml) you should be able to create a modified version in your schema.xml that uses the url field in its RenderPattern.
Following up on Tom's answer, you can use the SharePoint Solution Generator in VseWss 1.3 to generate a Visual Studio solution that can re-create your list. You will faint when you see the huge amount of XML that the views use in the schema.xml file but you will see the render pattern that Tom referred to and you should be able to get a general idea of how to modify it to suit your needs.
Gotta love SharePoint. Where small customizations means "take what I give you or rewrite it from scratch"

Resources