{"type":"rich","version":"1.0","provider_name":"phorkie","provider_url":"https:\/\/p.cweiske.de\/","title":"TYPO3 extbase: Page UID and content element UID","author_name":"Christian Weiske","cache_age":86400,"width":900,"height":900,"html":"<!-- embedding all files of https:\/\/p.cweiske.de\/761 -->\n<link rel=\"stylesheet\" href=\"https:\/\/p.cweiske.de\/css\/embed.css\"\/>\n<div class=\"phork\" id=\"761\">\n    <div class=\"phork-file\">\n <div class=\"phork-content\">\n  \n<div class=\"document\">\n\n\n<div class=\"section\" id=\"extbase-controller-v12\">\n<h1>Extbase controller v12<\/h1>\n<pre class=\"literal-block\">\n$this-&gt;currentRequest-&gt;getAttribute('routing')-&gt;getPageId();\n<\/pre>\n<p>or:<\/p>\n<pre class=\"literal-block\">\n$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n$uriBuilder-&gt;getRequest()-&gt;getAttribute('routing')-&gt;getPageId();\n<\/pre>\n<\/div>\n<div class=\"section\" id=\"extbase-controller-v10\">\n<h1>Extbase controller v10<\/h1>\n<p>Access the current page's ID and content element ID in an exbase controller action:<\/p>\n<pre class=\"literal-block\">\n$contentObj = $this-&gt;configurationManager-&gt;getContentObject();\n$pageUid = $contentObj-&gt;data['pid'];\n$contentElementUid = $contentObj-&gt;data['uid'];\n<\/pre>\n<\/div>\n<div class=\"section\" id=\"fluid\">\n<h1>Fluid<\/h1>\n<p>With vhs:<\/p>\n<pre class=\"literal-block\">\n{v:page.info(field: 'uid')}\n<\/pre>\n<\/div>\n<\/div>\n\n <\/div>\n <div class=\"phork-meta\">\n  <a href=\"https:\/\/p.cweiske.de\/761\/rev-raw\/6c136a085ad0cf746fe03aa8633172c8ee975577\/README.rst\" style=\"float: right\">view raw source<\/a>\n  <a href=\"https:\/\/p.cweiske.de\/761#README.rst\">README.rst<\/a>\n <\/div>\n<\/div>\n<\/div>\n"}
