How to render another page (not only content) in fluid - typo3

I search a way to render a page into another page.
I have a page with uid=186 and I want to render this on every page, so I try to render it in the layout.The page with uid=186 got another page template and also uses another layout (the layout is just empty, I don't really need a layout for that page).
My first try was:
<v:content.render pageUid="186" />
But that renders only the content, and also only the columns that are defined in the current page template, not the ones in the page templates I use in uid=186.
I also tried:
<v:render.request action="render" controller="Page" pageUid="186" extensionName="fluidpages"/>
But this leads to the PHP error:
mod_fcgid: stderr: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 29 bytes) in /var/www/vhosts/myhost/typo3_src-6.2.9/typo3/sysext/frontend/Classes/ContentObject/Menu/MenuContentObjectFactory.php on line 50
As I use a page template with much columns in the page uid=186 I would love to render the hole page as it is, and not fetch each column.
I would also be fine with a typoscript solution.
Anyone got an idea how I could archive that?

you can make a separate file that render the uid=186 with page layout of uid=186
First you have to separate the header and footer or may be you can define the different sections for header and footer in one file (for ex pageObjects.html). so you can render that section whenever you want.
<f:render section="Header" partial="PageObjects" arguments="{_all}" />
<v:content.render pageUid="186" />
<f:render section="Footer" partial="PageObjects" optional="TRUE" arguments="{_all}" />

Related

How to use t3:// TypoLinks in TYPO3 HTML Content Elements without disabling `parseFunc.htmlSanitize` globally?

Since the release of the security patches in August 2021 that prevents Cross-Site Scripting via Rich-Text Content I noticed that the output of HTML Content Elements suddenly changed in our projects. Some tag attributes and tags got removed by the newly introduced HTML Sanitizer (when the template is modified so that t3:// style TypoLinks get rendered).
So simply overriding the default Html.html Fluid Template, changing the <f:format.raw> to <f:format.html> and adding a html decoding like in the following example is no longer sufficient.
<f:section name="Main">
<f:comment> We use this to render links and other stuff in html elements </f:comment>
<f:format.htmlentitiesDecode>
<f:format.html parseFuncTSPath="lib.parseFunc">
{data.bodytext}
</f:format.html>
</f:format.htmlentitiesDecode>
</f:section>
The easiest way to prevent changes in your html codes output provided by HTML Content Elements is to disable the sanitizer globally by adding lib.parseFunc.htmlSanitize = 0 to your TypoScript config, what is not ideal.
How can I disable the parseFunc.htmlSanitize only for this purpose?
Or is there an other solution to render TypoLinks within HTML Content Elements?
Note: You don't need to disable the HTML Sanitizer if you do not override the Html.html template!
Simply make a copy of lib.parseFunc and disable the sanitizer in this copy.
lib.parseHtmlFunc < lib.parseFunc
lib.parseHtmlFunc.htmlSanitize = 0
Then use this lib in your Html.html template.
<f:section name="Main">
<f:comment> We use this to render links and other stuff in html elements </f:comment>
<f:format.htmlentitiesDecode>
<f:format.html parseFuncTSPath="lib.parseHtmlFunc">
{data.bodytext}
</f:format.html>
</f:format.htmlentitiesDecode>
</f:section>
Thanks to #OliverHader for bringing me to the right track.

Magento 2 Critical CSS file position

Is there a way to include inline styles after the <title> tag as shown on this image:
If I edit the file default_head_blocks.xml I can only get this to show after the merged css file which defeats the purpose of using critical-css. One possible way is to add this bit of code into default.xml but then the inline css is rendered right at the top of <head> before all the <meta> tags so I'm not sure if this is bad practice or not
<referenceBlock name="require.js">
<action method="setTemplate">
<argument name="template" xsi:type="string">Magento_Theme::/header/inline-css.phtml</argument>
</action>
</referenceBlock>
Since Magento 2.3 (or 2.2?) Magento has an option for Critical Css, here is the doc
In your (custom) theme you can define web/css/critical.css and then enable using critical css.
bin/magento config:set dev/css/use_css_critical_path 1
This css file will be injected as inline style into the head and the rest of styles will be loaded asynchronously.
AFAIK, placing the critical css in any position inside the head will do the job. The point is to load the other styles asynchronously. Otherwise the browser will still wait till all css files are loaded before loading the contents (body tag).
Please refer to this and this

data-nav-section from second html back to index.html not working correcty

Good day, I'm stuck here.
In my index.html there are header options to navigate directly to the following sections:
<li>Home</li>
<li>Portfolio</li>
<li>Werkwijze</li>
<li>Tarieven</li>
<li>FAQ</li>
<li>Contact</li>
This al works well. So far so good.
Now I have a portfolio html page with the same sections in the header that should navigate back to the index page.
<li>Home</li>
<li>Portfolio</li>
<li>Werkwijze</li>
<li>Tarieven</li>
<li>FAQ</li>
<li>Contact</li>
When I click on any option in the header (of the portfolio html) it does navigate to the index page but not to the correct section but always to the top of the page (home).
So what I want is that I click "Contact" in the header of the portfolio html and that I get to the contact section in the index page.
Does anyone have advice for me how to get it done?

Doxygen: Modules page content

In doxygen, if you create modules, the modules page will show up, with very basic content:
I would like to customize this page by added some description how the modules are related.
First thing I tried was to simply reference the "modules" page:
/*!
#page modules
Can you see this content?
#details This is some extra content!
#section Detail-Section
Show yourself!
*/
This adds a link to normal modules page in "related pages", but the things I enter there will still not show up. In fact, they seem to be completly ignored!
I was not able to find out where to add this content, but checking the genereated html file let's me assume that it is possible.
The following snippet shows the html code that comes after the table that lists the modules:
</table>
</div><!-- directory -->
</div><!-- contents -->
<!-- start footer part -->
So, is there a way to actually add "contents" with doxygen from a comment like for normal custom pages?

How to display everyone of the label and the radio choices in its own line?

I'm using Struts2. By default, when using the struts form, the label and the choices are displayed in the same line. How can I do to make the label in a line, and every radio choice in its own line? Is there a way by CSS? I need your help guys. Here it is how my form looks like. Thank you!
<s:form action="resultAction" namespace="/">
<s:radio label="Gender" name="yourGender" list="genders" value="defaultGenderValue" />
<s:submit value="submit" name="submit" />
</s:form>
Which theme are you using as by default struts2 use xHtml theme and which generate certain set of Tables to render the view.
Struts2 use free-marker template to render the HTML for tags and you can customize theme as per your choice or can create you rown theme.
Try with simple theme which will not generate any table or div and will render plain HTML for you are you have all way to apply your custom CSS to change/customize the view.
You can set the theme per page basis on for the whole application for per page basis add the following line in the head section
<s:set name="theme" value="'simple'" scope="page" />
for whole application you can either set in struts.properties file or in struts.xml file though the second one is more preferable.
<constant name="struts.ui.theme" value="simple" />
If you want to play with theme here is the link for same
struts-2-themes