How to Use subheader/subtitle in TYPO3 Content Elements - subtitle

How can I use the subheader or subtitle field in the content-element in the backend of TYPO3?

In TYPO3 offers you to use the field called subheader in your backend. To force TYPO3 to show this field set the following code line in your extention » ext_tables.php within the php-tags.
be aware you flush the backend cache and open the content-element again.
t3lib_extMgm::addToAllTCAtypes('tt_content', 'subheader', '', 'after:header');
after:header tells the TCA where to show it in the backend -> content element.

Related

TYPO3 v10: Remove <p> tags around paragraphs in custom RTE field (CKeditor)

I have a RTE field in my custom extension for TYPO3 10.4 with Fluid Styled Content. The RTE CKEditor automatically wraps each paragraph with a p tag. I'd like to get rid of this p tag. It's just a teaser field where I don't need line breaks or paragraphs.
What I tried so far is to create my own parseFunc via TypoScript to solve the problem during frontend output:
lib.parseFunc_my_teaser < lib.parseFunc_RTE
lib.parseFunc_my_teaser.nonTypoTagStdWrap.encapsLines >
lib.parseFunc_my_teaser.nonTypoTagStdWrap.encapsLines {
encapsTagList = p
remapTag.P =
}
In my Fluid template I use the parsefunc like this:
{article.data.teaser -> f:format.html(parseFuncTSPath: 'lib.parseFunc_my_teaser')}
This works and p tags are gone.
But I wonder if there is no nicer solution. I think I need to find a solution to tackle this problem either within the CKEditor configuration or via Page TSconfig. Unfortunately I wasn't able to find a proper approach.
By the way, another problem is, that in the "Info" Backend module of TYPO3 in my installation the view for Page TSconfig filtered by RTE. is empty. Any ideas on this?
I actually do that directly within an own RTE preset for CKE4 (tested in TYPO3 8, 9, 10 LTS):
editor.config.format_tags: "p"
editor.config.enterMode: 2
editor.config.shiftEnterMode: 2
With that an editor can't write P-tags. Even not in Source-Mode of CKE4.

How to set automatically highlite.js style for all pre tag

Everyone
I am making blogging site using quill.js. To view post in frontside I am using highlite.js.
In following image first 2 block are displayed with default side just <pre> tag.
and last one with <pre><code class="dart">{code}</code></pre>
My question is
I don't want to add manually html with <code class="dart">
I want automatic set styling by using just tag
I read all document but not found any specific answer how to set?
please any one?
I found answer. Using custom selector.
document.querySelectorAll('pre').forEach((block) => {
hljs.highlightBlock(block);
});

Algolia - Edit filter position in Magento2 template

I'm using the Algolia plugin for Magento2. I'm trying to style my instant search results page like the below site:
https://www.modaoperandi.com/search?categories%5B%5D=bags
In the above link, certain filters (like category and deliver) are in the sidebar, while other filters (like designer and color) are in the top bar above the results. Is there any way for me to split the Algolia filters up like this in the template?
It's doable, but the extension do not support it out of the box and it requires custom tweaks of the extension.
The container of facet filters is rendered in wrapper.phtml file. And then in instantsearch.js file each facet is rendered into a div appended to this container.
So what you may do is to tweak or write your own wrapper.phtml file, which will contain a new facet container for horizontal filters. And then update instantsearch.js file to place some widgets into this new container.
But be careful then with updating the extension as when you edit the extension's files directly, you will lose those changes on the version update of the extension.

Add a header and footer to magento through XML update

Is there any way to simply add the standard Magento header and footer to an "empty" layout by using the Layout Update XML?
I need this since I only have access to the CMS pages and not the source and want to have an empty column where I can try out inline designs.
Thanks!
You need to update PHP code for your header section. There is no such way to get data and simply add that in header or footer in Magento (CMS).
XML are used to import data only such as images, text, music etc.
If you have any concern, let us know anytime.
Thank You

Magento How to display the search results from search query in a custom page

In magento,
I would like to display the products retrieved from the search query in a custom pages.
By default these products are displaying in catalogsearch/result/?q="some text".
I would like to restrict this redirection and these search results have to be displayed on my custom pages (say index.php itself).
Can any one provide me the solution for this?
Thanks in advance
Mani
Go to
\app\design\frontend\default\your theme\layout/catalogsearch.xml
in line no 52:
<action method="setTemplate"><template>page/3columns.phtml</template></action>
change into:
<action method="setTemplate"><template>page/{YOUR PHTML FILE}</template></action>
You can do this via jQuery ajax request.
Onclick operation over the search button send the request to
catalogsearch/result/?q="some text"
You need to replace the entire html because on search we are getting entire magento search page(Not feasible)
OR
Create a custom module and override catalogsearch.xml remove header footer left and right navigation section and set body only.
This will do the job!!! Its working for me.
NOTE:CUSTOM MODULE DEVELOPED CAN BE USED TO OVERRIDE BLOCK,CONTROLLER ACTION AND ALSO WE CAN CHANGE AS PER REQUIREMENT

Resources