typo3,tt-news , tt_news single view with static news_id


tt_news single view with static news_id

Question:

Tag: typo3,tt-news

I am using Typo3 Version 6.2 with the plugin tt_news.

All I want to do is:

Use Case:

We have a company with many departments. For every department we have a couple of subpages on our website. Now I want to add specific news to each of those department websites. Like: On the team management page I want to show the news with ID = XY.

Is there any way to get this working?


Answer:

Insert the following lines to the setup field of an ext-template at the page where you want to display the selected news item in SINGLE view if no SINGLE view for another record was requested:

# hide the "no news id" message
plugin.tt_news._LOCAL_LANG.default.noNewsIdMsg =  
# set the tt_news singlePid to the current page
plugin.tt_news.singlePid = 977

# fill the content of the main-column to a tmp.object
tmp.pagecontent < page.10.subparts.contentarea

# clear the content of the main column
page.10.subparts.contentarea >

# build a new object for this column as content-object-array
page.10.subparts.contentarea = COA
page.10.subparts.contentarea {
  10 = CONTENT
  10.table = tt_news
  10.select {
# insert the pids of all pages from where you want to fetch news.
# the recursive-field has no influence on this selection
    pidInList = 25 # your pid
    # orderBy = datetime desc
    max = 1
   # get element with news id 10 @zarathustra
   where = tt_news.uid=10
  }
# insert the object “10.” only if there is no SINGLE news selected
  10.stdWrap.if.isFalse.data = GPvar:tx_ttnews|tt_news
# re-insert the normal pagecontent to the page
  20 < tmp.pagecontent
}

More information here http://docs.typo3.org/typo3cms/extensions/tt_news/3.5.1/ExtNews/Configuration/TyposcriptExamples/Index.html#default-news-id


Related:


Edit Publish Date in second language


typo3,typo3-6.2.x
Some of you might know the issue with the publishing and expiring date of elements and pages in other languages than the default. Setting the dates in the default language works perfectly. I copied the element into the secondary language. But there, the backend form fields (starttime / endtime) are...

How to assign variable in fluid?


typo3,fluid,view-helpers
I want viewhelper that can be helpful to assign variable in fluid, I dont want variable to be passed from controller.

uid of parent page or pid of current page for Typoscript db queries


typo3,typoscript
I want a list of uids of the current active parent of my menu. I got a solution, which gives me exactly that, however, my solution is really static, as it doesn't take the current active "parent" menu but a fixed value i typed in. Here is my code: lib.dbValues...

htaccess and authentication for multiple domains


.htaccess,typo3
I am running a mutlisite TYPO3-Site. For the pre-live process, I want to add a htaccess with a htpasswd for 3 / 4 sites. How can I configure the htaccess-file to trigger the authentication only for specific urls? For example: http://example.org shouldn't get a password-protection, while http://example2.org should. Both sites...

Remove default html header with typoscript


typo3,typoscript
I use an own extension which generates the html header and this works fine. Only the default header is still generated, so when we look at the page code there are two htlm headers generated. Even if I use the setting below. Any ideas? page = PAGE page.config { noPageTitle...

Fluid image with extra data for cycle2


typo3,fluid
I'm using cycle2 for a image slider, for adding a title extra data is needed in the image url, so I want to generate the following url: <img src="foto.jpg" data-cycle-title="Title" data-cycle-desc="Subtitle" /> I tried the following but this generates an error? <f:image src="foto.jpg" data-cycle-title="Title" data-cycle-desc="Subtitle" /> ...

Is it possible to set by fluid a argument that the typo3 backend uses as input


typo3,fluid
In the typo3 template I'm using the following line to get the last 5 added items from the backend and this works. <f:cObject typoscriptObjectPath="lib.lastaddeditmes" /> Only the number of item I want to have it flexible and set in the fluid template. So for example like below where the qty...

TYPO3 Solr extension and facets


solr,typo3,typoscript,typo3-6.2.x
I have a small question about TYPO3 solr facets.At present in my website I have 6 different indexing configuration available. Two of them are custom extension table's and one is tt_news and rest of the 3 are pages table with some custom condition. I managed to add this using additionalWhereClause...

Typoscript add class to the first element using stdWrap


typo3,typoscript,typo3-6.2.x
I have a custom requirement to display an image slider using TypoScript. The images are taken from default tt_content image content element. I've added the following TypoScript code to implement this; lib.homeslider = COA lib.homeslider { 10 = CONTENT 10 { table = tt_content select { where = colPos =...

How to get typo3 settings in the utility files?


php,typo3,fluid,extbase
plugin.tx_xxx { setting { storagePid = 23 } } I want this typo3 settings in utility file. Please help me....

Typoscript CASE & default value


typo3,typoscript
See below for my typoscript code typolink.parameter.cObject = CASE typolink.parameter.cObject { key.field = pid 3725 = TEXT 3725.value = 5574 5515 = TEXT 5515.value = 5574 3748 = TEXT 3748.value = 5574 default = TEXT default.data = pid } What I am trying to implement is , In a CASE...

Typo3 6.2 fluid pagination not working as expected


typo3,fluid,extbase,typo3-6.2.x,typo3-4.5
My typo3 6.2(Upgraded from Typo3 4.5) fluid paginate displays all the items instead of 5 items. My Repository Method : public function getRandomLocation($iLimit) { $query = $this->createQuery(); $result = $query->statement("Select * FROM tx_sfel_domain_model_ttblocationsproduktegruppen WHERE hidden = 0 AND deleted = 0 AND logo != '' ORDER BY uid LIMIT 0,...

File url [tmp_name] after upload via Typo3 backend


typo3,fluid
I'm building a typo3 extension and in a backend plugin I want to build a image upload form. I seem not to get the correct $_Files url. The following fluid form is used: <f:form action="customerSliderImages" id="customerSliderImages"> <f:form.upload name="custSlider[sliderimage]" /> <f:form.submit value="Upload" /> </f:form> I want to have the [name] and...

Where are TYPO3 constants from constant editor stored?


typo3,constants
In Typo3 Backend -> Template -> Constants there is a constant editor. Where does TYPO3 saving the constants? Tried an fgrep -ri for an existing pattern, in case of saving to filesystem - no matches. Tried an MySQL search for an existing pattern, in case of saving to DB -...

How does my frontend usergroup list get lost between Extbase action controller and Fluid template partial in TYPO3 6.2?


typo3,fluid,extbase,typo3-6.2.x,typo3-extensions
I'm using TYPO3 CMS 6.2.12 and Extension Builder 6.2.0 to model a Report class and build an extension to manage it. One of the domain driven design requirements is that a report author be a logged-in front end user. A second requirement is that the author choose a single group...

Language detection not working in Typo3 6.2.12


typo3,typoscript,typo3-6.2.x,language-detection
I've a website which has 2 languages: German (de) as default and English (en) as translated. I am trying to implement language detection functionality in the website using the extension "rlmp_language_detection" version 7.0.0. What I want to achieve is, for the countries Austria (at), Switzerland (ch) and Germany (de), the...

TYPO3 special menu “browse”


menu,typo3,typoscript
I'm trying to build a browse menu in TYPO3 that should be added to all subpages to navigate trough all submenu pages. That's what I got: temp.prevPage = HMENU temp.prevPage { special = browse special{ items = prev value = 22 prev.fields.title = <img src="fileadmin/dev/pics/prev.gif" title="next page" alt="prev page"/> }...

typo3 templavoila check current language


typo3,typoscript,templavoila
Hi i have 4 languages in my typo. Here is my main configuration for them: #LANGS config.linkVars=L config.defaultGetVars.L = 0 config.sys_language_overlay = hideNonTranslated [globalVar = GP:L = 3] config.sys_language_uid = 3 config.language = en config.locale_all = en_EN config.htmlTag_langKey = en plugin.tx_indexedsearch._DEFAULT_PI_VARS.lang = 3 [globalVar = GP:L = 2] config.sys_language_uid =...

Replace URLs in Typo3 DB


mysql,database,typo3
So I have a Site created with Typo3. I also have a domain which is linked to the folder of the Typo3 Installation. www.example.org I created a Subdomain and linked it to the same folder and used the Main Domain for something else. But now everything on the Subdomain still...

typo3 news realurl overwriteDemand


typo3,fluid,realurl
I am using Typo3 7.1 + Fluid(Latest Integrated with 7.1) and I am very new to this latest version. Added News plugin(tx_news) and using Categories. Categories are left menu and located in News List page as well as News Detail page. I am getting url look like this, http://domain.com/de/sample/?tx_news_pi1%5BoverwriteDemand%5D%5Bcategories%5D=5&cHash=8aa8fd1fb7a5e47165a4e4acca3125e9 I...

Clean way to switch between typo3 fluid page and action link


typo3,fluid
Is there a more clean way to switch between a page or a action link in fluid based on a var? Now i used the if then statement but this increases a lot of double code lines. See example: <f:if condition="{var}"> <f:then> <f:link.page pageUid="{PageId}"> // a lot of code lines...

How to get Query object to felogin repository?


typo3,typo3-6.1.x
i need Query object of TYPO3\CMS\Felogin\Controller\FrontendLoginController in my extention repository so i can create my own query conditions.

TYPO3 extbase create url in repository (not controller)


typo3,extbase
There are good tutorials on how to create URL's in the controllers like this one. Examples are: $this->uriBuilder->reset()->setTargetPageUid($page_uid)->setCreateAbsoluteUri(TRUE)->build(); $this->controllerContext->getUriBuilder()->reset()->setTargetPageUid($page_uid)->setArguments(array('person'=>$person->getUid())->buildFrontendUri(); In works from the controller. But I cannot do the same work in a repository. Error log say that reset() in first example and getUriBuilder in second example is called on...

typo3 flow persist updated relation


php,doctrine2,typo3,typo3-flow
I have an issue TYPO3 Flow updating my relations. Am I wrong, that Flow should update changed relations automatically, so I don't have to update the related entities with the respective repository? Example 1: I have a model "Project" with multiple "Job" childs on attribute "jobs". If I do: $project->setJobs($collectionOfJobs);...

why my frontend empty with automaketemplate after migration


typo3,typo3-6.1.x
I have an empty after migration from typo3 4.5 to 6.2.10. Hello world in body works but with the typoscript with the extension automaketemplate there is an empty body tag. Anybody have an idea why ? Thank you very much in advance. Mohamed...

TYPO3 Extbase build own Sitemap


typo3,sitemap,extbase
There are a lot of sitemap Generators for TYPO3 in the TER available. But none of them can handle Sites created by Extbase, which are not shown in the TYPO3 page tree. Edit Thanks to biesior, detailed informations: Unconventional I switch in TypoScript the GET Parameter for my Extbase extension[globalVar...

Display Extbase FileReference with Fluid


typo3,fluid,extbase,typo3-6.2.x
In an extbase extension, I have a FileReference Object. It was created with extension_builder originally. From The Model: /** * apprenticeshipDocument * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference */ protected $apprenticeshipDocument = NULL; etc. In the frontend, <f:debug>{institution.apprenticeshipDocument}</f:debug> gives me this: First Thing: originalResource is missing. Second: When calling {institution.apprenticeshipDocument.uidLocal} directly, the value is...

How to get filename in Typo3 solr extension with FAL and own Extbase extension


solr,typo3,extbase,typo3-6.2.x,fal
Before FAL, I can get the filename of an image from my own Extbase extension in the solr config file "typo3/ext/solr/Configuration/TypoScript/Solr/setup.txt" via index { queue { tx_myextension = 1 tx_myextension { fields { ... myimage_stringS = articleimage ... } } } } Where "articleimage" was a database field with the...

Hide typo3 content elements for specific user(groups)


typo3,typoscript
I want to "hide/deactivate" the table element for specific users/usergroups in the typo3 BE. Or to be more clear: I want to ONLY allow it to ONE specific user (admin). How can i do that? NOTE: At the moment the table element is deactivated in the global TS-config via tt_content...

PHP array passed by reference?


php,arrays,typo3,pass-by-reference,pass-by-value
I've been looking for an answer to this issue I have with an array but so far no answer here nor the web. We have a TYPO3 website that has indexed search configured and installed. We crawl records (~60000) using the crawler extension. Everything was configured and running fine but...

TYPO3 additional url rewrite for a plugin


.htaccess,mod-rewrite,url-rewriting,typo3
RealUrl is a great thing, but it doesnt solve all url problems. Many times I need to shorten the plugin's url. Or I have specific situation for shortening the urls... I'm searching a solution to rewrite the url and let the RealUrl to handle it after. This way I could...

How can I use an injected object in the constructor?


typo3,extbase
I have a service class in my Extbase extension and want to use the ObjectManager to create an instance of an object in the constructor. /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface * @inject */ protected $objectManager; public function __construct() { $this->standaloneView = $this->objectManager->get('TYPO3\CMS\Fluid\View\StandaloneView'); $this->standaloneView->setFormat('html'); } Unfortunately this doesn't fails with an error...

google sitemap for tx_news records with dd_googlesitemap_dmf (or alternative)


typo3,sitemap,typo3-6.2.x
I try to let typo3 generate a sitemap for all the news records. For that I tried the dd_googlesitemap_dmf extention. The dd_googlesitemap works (it creates a sitemap for all the typo3 pages - but not for extensions). I filled in the basic infos into the configuration and called the url...

Typo3 extbase database query


typo3,extbase,typo3-6.2.x,queryinterface
I have an extbase database query like below. $query = $this->createQuery(); $result = $query->statement("Select * FROM table1 WHERE hidden = 0 AND deleted = 0 AND (".$PublicationYears.") AND logo != '' ORDER BY uid ASC LIMIT 0, ".$iLimit." ")->execute(); return $result; $PublicationYears = "ttra = '12' or ttra = '13'...

Using FAL in Extbase correctly


typo3,extbase,fal
Domain model class Image extends AbstractContent { /** * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference */ protected $file; /** * Gets the image file * * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference */ public function getFile() { return $this->file; } /** * Sets the image file * * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $file * @return void */ public function setFile($file)...

Typo3 6.2: “Could not find a suitable type converter for ”String“ ” exeption after update


php,typo3,typo3-6.2.x
Typo3 was from a very old version updated to Typo3 6.2. The most things are working now, but I have one own written extension that give me the following error: Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1297759968: Exception while property mapping at property path "":Could not find a suitable...

Copy typo3 to a new domain


typo3,typo3-6.2.x
I try to copy a typo3 installtion to a new directory (and new domain), but got some problems I can't figure out where they come from. What I have done is: I copied all the files to the new directory (New domain is mapped to this directory). I copied the...

How to use Hook “processDatamap_postProcFieldArray” in TYPO3 6.x


php,typo3,extbase,typo3-6.2.x
Use case: When saving an object (in backend, maybe in frontend too later) I want to manipulate values before saving to database. Problem: The file seems to get included (shows an error on save if I choose a wrong file path) but the function does not seem to be executed...

PHP error “Cannot redeclare class” in extbase-based extension of Typo3 4.7


php,typo3,extbase
I have created an extension for Typo3 4.7 (actually, it was created for Typo3 6.2, but I am trying to backport it) using the extbase framework. I have already removed all namespaces from the core and also checked TYPO3 - Call another repository. However, I have the problem that calling...

PHP errors parsing Realurl config file


php,typo3
I have installed the typo3 rearurl extension in Typo3. If I copy to the default manual config location typo3conf/realurl_conf.php a configuration file with for example: <?PHP $TYPO3_CONF_VARS['EXTCONF']['realurl'] = array( '_DEFAULT' => array( ), ); ?> I getting PHP errors like below? Parse error: syntax error, unexpected '$TYPO3_CONF_VARS' (T_VARIABLE) in /home/extension/public_html/typo3conf/realurl_conf.php...

tt_news single view with static news_id


typo3,tt-news
I am using Typo3 Version 6.2 with the plugin tt_news. All I want to do is: Have a simple page on my website On that page I want to have a tt_news single view the news_id of this view should be static (set by me) and NOT by GET variables...

Automatically go into list view when going to a folder


typo3,typo3-6.2.x
When clicking on a folder in TYPO3 CMS backend, I get this message: The current page is a folder. Folders usually don't contain content elements but are used for collecting other types of records. Can I make TYPO3 go into list view automatically? I don't see no reason why it...

How to disable cache for a image carousel in TYPO3


caching,typo3,typoscript,extbase,typo3-6.2.x
My TYPO3 extension has a lib that generates random 5 images from the total stock, for example out of the 100 images. This is done randomly every time the page is loaded. Only default the TYPO3 cache is enabled so every time the same 5 images are showed. As the...

Routes for TYPO3 Neos plugin


typo3,typo3-flow,typo3-neos
I'm trying to define routes for my plugin. Everything is working as it should, because I got pretty URL on output, but unfortunately while I'm trying to access it I get an 404 error with message: #1303209195: No controller could be resolved which would match your request. Package key: "",...

How can I render preview of FE plugin diplayed in Page module


typo3,backend,extbase,typo3-6.2.x,typo3-extensions
I have developed TYPO3 (6.2) extensions with some FE plugins. I need to change informations about plugin, which is displayed in the backend on page view. Now only Title and name of plugin is displayed ... I have used flexforms for configure the plugin and I would like to show...

TYPO3-Upgrade 4.5 to 6.2: namespaces


namespaces,typo3,typo3-6.2.x
I'm updating an old TYPO3 to latest verison 6.2.12. As I do so I replace deprecated classes with the proper namespaces. E.g. t3lib_div to \TYPO3\CMS\Core\Utility\GeneralUtility or t3lib_extmgm to \TYPO3\CMS\Core\Utility\ExtensionManagementUtility. But I cant find the proper namespaced class for t3lib_svbase. Any suggestions? . And I absolutely have no clue what I...

userfunc condition for detecting mobile device


typo3,typoscript,typo3-7.x
Since TYPO3 7 the condition 'device' and 'useragent' are deprecated. No I'm looking for a userFunc to use as a condition for detecting mobile devices. My aim is to hide or to show some special pages on mobile devices. I used the extension 'contexts_wurfl' for a while but I guess...

Show Typo3 FlexForm checkbox items inline


typo3
Would it be possible to show the checkboxes inline, so behind each other with a FlexForm? I'm now using the following code, but this shows every setting in a vertical list. <settings.ownchoice_for_sale> <TCEforms> <label>For sale</label> <config> <type>check</type> </config> </TCEforms> </settings.ownchoice_for_sale> <settings.ownchoice_reserved> <TCEforms> <label>Reserved</label> <config> <type>check</type> </config>...

How to end typo3 realurl with .html


typo3,realurl
I'm using the realurl extension to make nice urls, only they all end with the / char. How can I let them end like a .html file? /path/to/page/ Would like to have: /path/to/page.html...