Menu
  • HOME
  • TAGS

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

Tag: 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 some of configuration on the plugin "placeholder" in the backend.

I remember, I read some documentation how to do it a few years ago, but I can't find it anymore...

Does anyone know the right way to do it?

Best How To :

If I understood well you are asking for ContentElement preview. You need to use cms/layout/class.tx_cms_layout.php hook for this, here's quite nice gist

just two additions:

  1. don't use t3lib_extMgm class it's removed since 7.x you can register this hook just with:

    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem'][$_EXTKEY] 
    =  'EXT:your_ext/Classes/Hooks/PageLayoutView.php:\Vendor\YourExt\Hooks\PageLayoutView';
    
  2. Depending on how did you register the plugin (didn't mention) you can also need to check the $row['list_type'] as your $row['CType'] may be just generic list.

Sample class with value from FlexForm field

<?php

namespace Vendor\YourExt\Hooks;

class PageLayoutView implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface {

    public function preProcess(\TYPO3\CMS\Backend\View\PageLayoutView &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row) {
        if ($row['CType'] == 'list' && $row['list_type'] == 'yourext_yourplugin') {

            $drawItem = false;

            $linkStart = '<a href="#" onclick="window.location.href=\'../../../alt_doc.php?returnUrl=%2Ftypo3%2Fsysext%2Fcms%2Flayout%2Fdb_layout.php%3Fid%3D' . $row['pid'] . '&amp;edit[tt_content][' . $row['uid'] . ']=edit\'; return false;" title="Edit">';
            $linkEnd = '</a>';


            $headerContent = 
                $linkStart . 
                "<strong>Selected slides</strong>" .
                $linkEnd;


            $ffXml = \TYPO3\CMS\Core\Utility\GeneralUtility::xml2array($row['pi_flexform']);

            $itemContent =
                $linkStart .
                $ffXml['data']['sDEF']['lDEF']['settings.myFlexField']['vDEF'] .
                $linkEnd;
        }
    }
}

Forbid user to login from two or more Android devices at the same time

java,php,android,session,backend

Why use something similar to php sessions? use php sessions instead! session_start(); $sess_id = session_id(); Give this id to your client, and make sure it appears in every requests the client application makes to your server. Here is how you load a session by id : session_id("your_client_session_id"); session_start(); Basically it's...

Typo3 extbase database query

typo3,extbase,typo3-6.2.x,queryinterface

first of all you dont need this $query->matching( $query->logicalAnd( $query->equals('deleted', 0), $query->equals('hidden', 0) )); disable fields are included in query from default according to setting of table in ext_tables.php multiple matching will not work cause your third matching $query->matching($query->logicalNot( $query->equals('logo', '') )); is overwriting the matching() used before it logicalAnd...

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

php,typo3,typo3-6.2.x

I think it needs to be /** * action show * * @param string $id Course-Id * @return void */ public function showAction($id){ } string lowercase and the argument $id must be specified as well...

userfunc condition for detecting mobile device

typo3,typoscript,typo3-7.x

You can accomplish this with TypoScript using the PAGE Object. The code below shows you how to execute your own code before executing something else (like the template engine/content rendering etcetera). page.01 = USER_INT page.01 { userFunc = TYPO3\MyExt\Utility\MobileDeviceUtility->detectMobileDevice } And in code: <?php namespace TYPO3\MyExt\Utility; class MobileDeviceUtility { /**...

Hide typo3 content elements for specific user(groups)

typo3,typoscript

Note: I have only an old Typo3 4.3.5 installation, but I hope this hasn't changed much. In User admin, edit group permissions and go to Access lists. At the bottom is "Explicitly allow/deny field values" where you can restrict specific content types. With the restriction, affected users still see the...

Language detection not working in Typo3 6.2.12

typo3,typoscript,typo3-6.2.x,language-detection

I've added the following configuration; plugin.tx_rlmplanguagedetection_pi1 { useOneTreeMethod = 1 defaultLang = de limitToLanguages = de,en } page.987 =< plugin.tx_rlmplanguagedetection_pi1 I understood that the functionality is not working only with this configuration. We need to "Select Official Language (ISO code):" in the website langauge ( alternate language we added in...

tt_news single view with static news_id

typo3,tt-news

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 = &nbsp; # set the tt_news singlePid...

How to get Query object to felogin repository?

typo3,typo3-6.1.x

I think Below code is useful to you $query = $this->persistenceManager->createQueryForType('TYPO3\CMS\Extbase\Domain\Model\FrontendUser'); Write in this your extension repository....

File url [tmp_name] after upload via Typo3 backend

typo3,fluid

It seems you did not define the enctype attribute on the <f:form> tag. <f:form ... enctype="multipart/form-data"> ... </f:form> See also: http://www.w3schools.com/tags/att_form_enctype.asp http://wiki.typo3.org/Fluid#f:form ...

Using FAL in Extbase correctly

typo3,extbase,fal

I get the hint in the Slack channel of TYPO3. You just need to set plugin.tx_myext.persistence.updateReferenceIndex = 1 respectively module.tx_myext.persistence.updateReferenceIndex = 1 and the index will be updated. Alternatively you could use \TYPO3\CMS\Core\Database\ReferenceIndex::updateRefIndexTable()....

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

typo3,backend,extbase,typo3-6.2.x,typo3-extensions

If I understood well you are asking for ContentElement preview. You need to use cms/layout/class.tx_cms_layout.php hook for this, here's quite nice gist just two additions: don't use t3lib_extMgm class it's removed since 7.x you can register this hook just with: $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem'][$_EXTKEY] = 'EXT:your_ext/Classes/Hooks/PageLayoutView.php:\Vendor\YourExt\Hooks\PageLayoutView'; Depending on how did you register the...

Boltdb-key-Value Data Store purely in Go

go,backend,datastore,key-value-store,boltdb

A Bolt database is usually embedded into a larger program and is not used over the network like you would with shared databases (think SQLite vs MySQL). Using Bolt is a bit like having a persistent map[[]byte][]byte if that were possible. Depending on what you are doing, you might want...

Typo3 6.2 fluid pagination not working as expected

typo3,fluid,extbase,typo3-6.2.x,typo3-4.5

To fix the above issue i rebuilt the query in extbase query format. In typo3 6.2.x paginate will not work with query statement so we need to convert it into extbase query format. My rebuilt query format is, $constraints = array(); $subConstraints = array(); $query = $this->createQuery(); foreach($PublicationYears as $year)...

How to create a blog on nodejs(with express.js)?

javascript,node.js,express,blogs,backend

You can checkout mean.js. It is a fullstack javascript framework that lets you generate crud modules (articles for your blogs) and more.

TYPO3 extbase create url in repository (not controller)

typo3,extbase

First of all, you shouldn't do this. For creating URIs in Extbase, you need access to the current controller context, because there are several factors that go into creating an URI (currently called controller action, current host name, selected language, ...). If you would create URIs within your repository (i.e....

TYPO3-Upgrade 4.5 to 6.2: namespaces

namespaces,typo3,typo3-6.2.x

To use the new XLASS feature, you need to provide a proper autoloading, by either sticking to the convention or by creating an ext_autoload.php file. http://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Autoloading/Index.html http://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Xclasses/Index.html...

Can't login to Magento admin panel

magento,login,admin,backend,magento-1.9

If everything works on the front end like you said, and you just can't log into the admin, most probably you have the original adminhtml cookie pointing to your original domain, (www.site.com) and an extra adminhtml cookie for your development domain (subdomain.site.com). In Chrome, in Developer Tools (right-click on any...

typo3 templavoila check current language

typo3,typoscript,templavoila

Using translation labels in TypoScript You can use a translation label in TypoScript. For example: {LLL:typo3conf/customlabels.xlf:label.id} {LLL:EXT:mytemplateext/Resources/Private/Language/locallang.xlf:label.id} You may want to look at: http://docs.typo3.org/typo3cms/FrontendLocalizationGuide/BasicSetupOfALocalizedWebsite/Llxml%28locallang-xml%29InPluginsAndTyposcript/Index.html llXML files are XML files containing labels that the system can fetch in a localized version if a language pack is installed. If you want to...

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

php,typo3,extbase,typo3-6.2.x

Solved: in my ext_localconf.php there was just a '/' missing inside the namespace ... $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'EXT:navolspmanager/Classes/Hooks/GetGeoCodesHook.php:\NachVORNE\Navolspmanager\Hooks\GetGeoCodesHook'; Improvements: When updating one field according to other user input we should use the 'processDatamap_postProcessFieldArray' function. That way trim, date and number stuff etc is already done at the moment we grep the...

backend not being reset by matplotlibrc.py

python,osx,matplotlib,backend

As outlined in the documentation the rc file has no .py extension: On Linux, it looks in .config/matplotlib/matplotlibrc [...] On other platforms, it looks in .matplotlib/matplotlibrc. In fact it does not have python syntax but rather uses a yaml-like dictionary structure. So it is likely that matplotlib does not use...

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

solr,typo3,extbase,typo3-6.2.x,fal

Solution found: index { queue { tx_myextension = 1 tx_myextension { fields { ... bild_stringS = FILES bild_stringS { references { table=tx_myextension_model_name uid.data = field:uid fieldName=artikelbild } renderObj = TEXT renderObj { stdWrap.data = file:current:publicUrl stdWrap.wrap = | } } } } } } This way I get the URL,...

How to disable cache for a image carousel in TYPO3

caching,typo3,typoscript,extbase,typo3-6.2.x

in your ext_localconf.php there, where you added your plugin make an usage of the 4-th param of configurePlugin method \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'Vendor.' . $_EXTKEY, 'PluginName', array('Customers' => 'slider',), array('Customers' => 'slider',) // List non-cachable action(s) ); Of course fix the VendorName and PluginName to your own. It will cause that plugin's...

Architecture for cross platform messaging app

android,google-app-engine,backend,ejabberd,google-cloud-messaging

Announced last week: Engage your users across Android, iOS and Chrome via Google Cloud Messaging 3.0: https://developers.google.com/cloud-messaging/ https://www.youtube.com/watch?v=gJatfdattno ...

Fluid image with extra data for cycle2

typo3,fluid

Since data-cycle-title and data-cicle-desc are not registered arguments within the ImageViewHelper you cant pass those values directly. But there is a additionalAttributes argument for the rescue. You can add as many attributes as you like to have in your image tag. additionalAttributes expects an array notation: <f:image ... additionalAttributes="{data-cycle-title: 'Title',...

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

Your variables are not passed to the partial, so {groups} is not a variable inside your Partial. You can specify the variables you want to use in the partial by giving the attribute arguments on your <f:render.partial> like in your case: <f:render partial="Report/FormFields" arguments="{groups : groups}" /> Since TYPO3 4.6...

How to end typo3 realurl with .html

typo3,realurl

In your realurl configuration file (usually typo3conf/realurl_conf.php1) there is a section fileName. In it there is a key defaultToHTMLsuffixOnPrev. Set it's value to 1. Should look somehow like this afterwards (generated by realurl autoconfig): 'fileName' => array( 'defaultToHTMLsuffixOnPrev' => 1, // <-- Important part 'acceptHTMLsuffix' => 1, 'index' => array(...

Routes for TYPO3 Neos plugin

typo3,typo3-flow,typo3-neos

Ok, I finally figure out what was wrong. I defined my route for plugin with optional params, which somehow was wrongly interpreted by request handler. Correct routes for my plugin should looks as follows: - name: 'Nice urls for my plugin' uriPattern: '{node}/q/{--acme_myplugin-element.object1}/{--acme_myplugin-element.object2}' defaults: '@package': 'TYPO3.Neos' '@controller': 'Frontend\Node' '@action': 'show'...

What is a full-stack developer?

frontend,backend

This is a classic debate between generalist and specialist. For small company like startup, they tend to hunt for someone that can wear multiple hats given limit resources, i.e. generalist. For mid-large company, they have the luxury to hire expert for each line of their business, thus, specialist or consultant...

htaccess and authentication for multiple domains

.htaccess,typo3

This will make it so authorisation unless the host ends in example2.com # set the "require_auth" var if Host ends with "example2.com" SetEnvIfNoCase Host example2\.com$ require_auth=true # Auth stuff AuthUserFile /var/www/htpasswd AuthName "Password Protected" AuthType Basic # Setup a deny/allow Order Deny,Allow # Deny from everyone Deny from all #except...

How to put unicode chars in javascript

javascript,unicode,backend

To reference non-ASCII characters in a JavaScript file that isn't served Unicode-safe, use JS string literal character escapes: \uNNNN where NNNN is a the hex number of the UTF-16 code units associated with the string (same as the code point number for characters like these in the Basic Multilingual Plane)....

How to handle backend (laravel) and frontend (angular) dependencies in different git repos

angularjs,git,laravel,backend,web-frontend

This answer is just one of the many ways to accomplish this and defining a "best approach" is quite relative. 1. Create separated virtual hosts to different branches (dev, release, master..) In your Apache or Nginx, create different hostnames for different branches and, in each root directory (like public_html) pull...

Typoscript CASE & default value

typo3,typoscript

Use default.data = field:pid instead of default.data = pid. TYPO3 needs to know where to look for pid, it could be a request parameter, register, configuration setting and so on as well.

typo3 flow persist updated relation

php,doctrine2,typo3,typo3-flow

From the Flow manual: When you add or remove an object to or from a repository, the object will be added to or removed from the underlying persistence as expected upon persistAll. But what about changes to already persisted objects? As we have seen, those changes are only persisted, if...

How to connect from your iOS app to a backend server? how to read,modify and fetch data to backend server?

ios,objective-c,server,fetch,backend

First, you have to create API in ruby. Here is a tutorial on how to do it: https://www.codeschool.com/courses/surviving-apis-with-rails. After that, when you are sure that your API is working correctly, you can write a service for HTTP communication. You can do it by yourself, but in my opinion much better...

How to assign variable in fluid?

typo3,fluid,view-helpers

Define namespace like following at the top {namespace v=FluidTYPO3\Vhs\ViewHelpers} Then use set viewhelper <v:variable.set name="test" value="12345" /> {test} {test} will return value 12345...

Replace URLs in Typo3 DB

mysql,database,typo3

There are two (three with realurl) places where you need to look if changing the domain of a TYPO3 site, if everything is done by the book and noone hardcoded the domain all over the place or something. Usually you do not need to work in the database directly. After...

How to get typo3 settings in the utility files?

php,typo3,fluid,extbase

You can add below line in the your controller. $objectManager = \TYPO3\CMS\Core\UtilityGeneralUtility::makeInstance('Tx_Extbase_Object_ObjectManager'); $configurationManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager'); $this->setting = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT); $this->ts_config = $this->setting['plugin.']['tx_xxxx.']['settings.']['storagePid']; I think...

Call function on Server from iOS app - Objective C

ios,objective-c,json,server,backend

You just need to POST data to your server. Port could be anything you want, should be 80. Host your script with a domain url so that you can make network request publicly. You can try this function: -(NSData *)post:(NSString *)postString url:(NSString*)urlString{ //Response data object NSData *returnData = [[NSData alloc]init];...

Copy typo3 to a new domain

typo3,typo3-6.2.x

empty the typo3temp folder did the trick.

Replying to a request in ruby on rails (Server side)

ruby-on-rails,ruby,web-applications,backend,web-frontend

Once the server has done its math (in the controller), you can return your array like the below: def my_action my_array = # store the array here render json: my_array end You can also have the response in different formats.. def my_action my_array = # store the array here respond_to...

TYPO3 Solr extension and facets

solr,typo3,typoscript,typo3-6.2.x

I assume that your type-field in the solr index only has 4 values, one for pages, 1 each for the two custom tables, and 1 for news. In order to get 6 facets, you need to have 6 different values in the field the faceting is done on. I'm not...

Typoscript add class to the first element using stdWrap

typo3,typoscript,typo3-6.2.x

Your original TS is fine. Supposing you have the images in the same CE (Content element), not in several CEs. As such: For easier readability, I have modified the following line: stdWrap.wrap = <div class="item active">A|ENDA</div>|*|<div class="item">B|ENDB</div>|*|<div class="item">C|ENDC</div> Which gives me: <div id="c1531" class="csc-default"> <div id="carousel-example-generic" data-ride="carousel" class="carousel slide carousel-fade">...

Clean way to switch between typo3 fluid page and action link

typo3,fluid

You can extract the code within the links into a partial. For this, first create a partial template. Inside an Extbase extension, they are placed in Resources/Private/Partials by convention (you can change this by using the setPartialsRootPath() method on the template object, but usually that shouldn't be necessary). # Resources/Private/Partials/LinkContent.html...

TYPO3 Extbase build own Sitemap

typo3,sitemap,extbase

If you use ts for create sitemap you can add any items. http://www.adick.at/2010/06/01/typoscript-xml-sitemap/. MB this will help 20 = CONTENT 20 { table = tx_adprojects_domain_model_project select { orderBy = title ASC languageField = sys_language_uid pidInList = 11,12,13,14,15,30 } renderObj = COA renderObj { stdWrap.wrap = <url>|</url> 5 = TEXT 5...

google sitemap for tx_news records with dd_googlesitemap_dmf (or alternative)

typo3,sitemap,typo3-6.2.x

I had to downgrade dd_googlesitemap (using 1.2.0 now) to get dd_googlesitemap_dmf to work

Show Typo3 FlexForm checkbox items inline

typo3

Flexforms does not support such palette functionality like TCA offers. You can use a multiple value selector to offer all available options in a single field instead of using checkboxes (see: http://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Select/Index.html#columns-select-examples-multiple). An example of this in your case: <settings.ownchoice> <TCEforms> <label>Own Choice</label> <config> <type>select</type> <items> <numIndex index="0"> <numIndex index="0">For...

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

typo3,fluid

You can't do that in the view, instead you can make a copy of lib.lastaddeditmes in TypoScript and then use it in other place like: lib.lastaddeditmesOnlyThree < lib.lastaddeditmes lib.lastaddeditmesOnlyThree.someSetting.items = 3 and in view: <f:cObject typoscriptObjectPath="lib.lastaddeditmesOnlyThree" /> Remember that TypoScript is just a configuration syntax (not programming language) so it...

Run Alfresco Java code as Administrator

java,admin,alfresco,backend,runas

To detail the answer from Krutik, you should wrap code in a runAsSystem block like this: final permissionService = serviceRegistry.getPermissionService(); //Read the username of the current user final String loggedInUser = authenticationService.getCurrentUserName(); ChildAssociationRef childAssociationRef = nodeService.getPrimaryParent(actionedUponNodeRef); //Get the parent NodeRef NodeRef parent = childAssociationRef.getParentRef(); String fileName = (String) nodeService.getProperty(parent, ContentModel.PROP_NAME);...

Where are TYPO3 constants from constant editor stored?

typo3,constants

The constants set in the constant editor are stored in TypoScript syntax in the field constants of the table sys_template.