Project

General

Profile

Actions

Feature #38942

closed

Make data of ContentElement available in Fluid

Added by Felix Nagel over 12 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2012-07-13
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Please make CE uid available in fluid. See http://lists.typo3.org/pipermail/typo3-project-typo3v4mvc/2012-April/012164.html

This is often needed when using Java-Script within the templates.

Actions #1

Updated by Oliver Hader over 12 years ago

  • Status changed from New to Accepted

Makes sense... the name should be configurable however...

Actions #2

Updated by Marc Bastian Heinrichs over 12 years ago

I never needed the CE uid till now, so I think it should be handled extension specific.

But if the majority is +1, it should be implemented with FLOW3's FLUID in mind.
Function getContentObject() is v4/6 specific thing because FLOW3 has no content element
and if there would be anything like this, it has no uid, but an identifier.

Actions #3

Updated by Felix Nagel over 12 years ago

I understand your concern but isn't extbase a TYPO3 extension and should we be worried about eventually upcoming FLOW3 based projects?
Anyway, what about a more generic, configurable way to retrieve a unique identifier?

Currently a viewHelper already has the uid in its context, but I needed the cObj when working inside partials.

class Tx_MyExt_ViewHelpers_UidViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {

  /**
   * @var Tx_Extbase_Configuration_ConfigurationManagerInterface
   */
  protected $configurationManager;

  /**
   * @param Tx_Extbase_Configuration_ConfigurationManagerInterface An instance of the Configuration Manager
   * @return void
   */
  public function injectConfigurationManager(Tx_Extbase_Configuration_ConfigurationManagerInterface $configurationManager) {
    $this->configurationManager = $configurationManager;
  }

  /**
   * Set uid of the content element
   *
   * @return int $uid The uid of the content element
   */
  public function render() {
    // fallback
    $uid = uniqid();

    if ($this->templateVariableContainer->exists("contentObjectData")) {
      // this works for templates but not for partials
      $contentObjectData = $this->templateVariableContainer->get("contentObjectData");
      $uid = $contentObjectData['uid'];
    } else {
      // this should work in every circumstance
      $cObj = $this->configurationManager->getContentObject();
      $uid = $cObj->data['uid'];
    }

    return $uid;
  }
}

Actions #4

Updated by Anja Leichsenring almost 12 years ago

  • Project changed from 534 to 2559
  • Category changed from 965 to Fluid
Actions #5

Updated by Alexander Opitz over 10 years ago

  • Status changed from Accepted to Needs Feedback

Hi,

was this issue fixed or does it still exists?

Actions #6

Updated by Felix Nagel over 10 years ago

Still missing in core afaik. So please, do not close this.

Actions #7

Updated by Alexander Opitz over 10 years ago

  • Project changed from 2559 to TYPO3 Core
  • Category changed from Fluid to Fluid
  • Status changed from Needs Feedback to New
Actions #8

Updated by Riccardo De Contardi over 9 years ago

+1 I would like it too!
(Maybe VHS has something ;))

Actions #9

Updated by Claus Due about 9 years ago

Just a tiny update from the side lines: this issue has been reviewed, judging if it has any impact on or is affected by the merging of the standalone Fluid package as TYPO3 dependency.

Verdict: NOT AFFECTED. This feature should, however, be very carefully considered - my suggestion would be to add a ViewHelper in Fluid (the TYPO3 adapter, not the standalone package) that will return the current cObj as stored in ConfigurationManager.

Actions #10

Updated by Bernhard Eckl about 9 years ago

Why only the uid of the content element and not all content element properties? I would need section_frame or layout…

Actions #11

Updated by Claus Due almost 9 years ago

Does anyone want this anymore? It doesn't appear to be a hot topic... ;)

Actions #12

Updated by Riccardo De Contardi almost 9 years ago

From my part, I continue to think it could be useful :)

Actions #13

Updated by Markus Klein almost 9 years ago

We recently needed this. Shall we implement this somehow for CMS 8?

Actions #14

Updated by Gerrit Code Review almost 9 years ago

  • Status changed from New to Under Review

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/46473

Actions #15

Updated by Gerrit Code Review almost 9 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/46473

Actions #16

Updated by Gerrit Code Review almost 9 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/46473

Actions #17

Updated by Gerrit Code Review almost 9 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/46473

Actions #18

Updated by Gerrit Code Review almost 9 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/46473

Actions #19

Updated by Gerrit Code Review almost 9 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/46473

Actions #20

Updated by Gerrit Code Review almost 9 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/46473

Actions #21

Updated by Gerrit Code Review almost 9 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/46473

Actions #22

Updated by Gerrit Code Review almost 9 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/46473

Actions #23

Updated by Anonymous almost 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #24

Updated by Helmut Hummel almost 9 years ago

  • Status changed from Resolved to New

The merged patch did not solve this ticket and was reverted due to several other issues

Revert: https://review.typo3.org/#/c/47209/

Actions #25

Updated by Helmut Hummel almost 9 years ago

  • % Done changed from 100 to 0
Actions #26

Updated by Benjamin Kott almost 8 years ago

  • Status changed from New to Needs Feedback

Hey, mabe someone can point me here into the right direction. Personally i would consider this issue as resolved. If you assign a fluidtemplate for the content element rendering it has automaticly the record information as data assigned. When using extbase you have also all Information available in the context but it needs to be assignes manually to the view. Is there something i am missing?

Actions #27

Updated by Markus Klein almost 8 years ago

@Benji: AFAIK we still lack the page information in a FLUIDTEMPLATE.

Actions #28

Updated by Alexander Opitz over 7 years ago

  • Subject changed from Make CE UID available in Fluid to Make data of ContentElement available in Fluid
  • Status changed from Needs Feedback to New
Actions #29

Updated by Benjamin Kott almost 7 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

The original feature request was to have record data available in fluidtemplate. We currenlty have page information and also record information available depending on the context.
In addition we have data processors available to also fetch data from a different context if nessesary. This means we have everything available and ready for use thats nessesary
to get the job done. Fetching the full page record in a record for no reason does not make sense, if it is nessesary its easy possible.
Current data can be accessed within the fluid template by accessing the preassigned variable {data}.

This issue and the feature asked for is provided and the issue can be closed.

Actions

Also available in: Atom PDF