Home > Net >  TYPO3 - not showing up my contents after creating custom content element
TYPO3 - not showing up my contents after creating custom content element

Time:11-17

I created a custom content element on my TYPO3 ver. 10.4.21 and I could show a HTML-file (in /Resources/Private/Templates/ContentElements/NewContentElement.html) once, but after changing a tt_content.php file I couldn't show up my content any more.... (I wanted to configrate some field on a edit page after creating the content element.)

My question is in this case:

  • Does Symfony Expression Language do something?
  • cache?

My template path is following:

lib.contentElement {
  templateRootPaths {
    100 = EXT:mein_projektarbeit/Resources/Private/Templates/
  }
  partialRootPaths {
    100 = EXT:mein_projektarbeit/Resources/Private/Partials/
  }
  layoutRootPaths {
    100 = EXT:mein_projektarbeit/Resources/Private/Layouts/
  }
}

In template I can see this path:

[100] = EXT:mein_projektarbeit/Resources/Private/Templates/ # register a content elements # # Path to Templates, Partials, Layouts

I could show my contents up from my NewContentElement.html, so I think that the template path is correct.

Tried:

I activated and deactivate my extension and after that I cleared the cashes. Also, the extension is included static in root(Template > include > my extension on the left side) again. But I can't see my content any more, even if my html-file (NewContentElements.html) is in mein_projektarbeit/Resources/Private/Templates/.


Is there anything to do for this problem?

MEMO: This is my folder structure:

myextension
     ├── Classes
     |   ├── Controller
     |   ├── Domain
     |   |   ├── Model
     |   |   └── Repository
     |   └── ViewHelpers
     ├── Configuration
     |   ├── TsConfig
     |   ├── TCA            
     |   └── TypoScript
     ├── Documentation
     ├── Resources
         ├── Private
         |   ├── Language
         |   ├── Layouts
         |   ├── Partials
         |   └── Templates
         |         └─ ContentElements
         |               └─ NewContentElement.html 
         └── Public
             ├── Css
             |     └─ layout.min.css  
             ├── Js
             └── Icons

I tried to make a new custom content Element with another domain and I could make it. Is it just a one time possible to make a custom content element in a domain? I can't believe it, but it's not working anymore with my same domain. But I want to avoid to make one more Domain for this.... Please help me if you can.

MEMO: SQL-code on debug, if I show my main page. uid=22 is right.

SELECT * FROM `pages` WHERE (`uid` = 2) AND (((`pages`.`deleted` = 0) AND (`pages`.`t3ver_state` <= 0) AND (`pages`.`t3ver_wsid` = 0) AND (`pages`.`t3ver_oid` = 0) AND (`pages`.`hidden` = 0) AND (`pages`.`starttime` <= 1637053080) AND ((`pages`.`endtime` = 0) OR (`pages`.`endtime` > 1637053080))) AND (`pages`.`doktype` <> 255)) AND (((`pages`.`fe_group` = '') OR (`pages`.`fe_group` IS NULL) OR (`pages`.`fe_group` = '0') OR (FIND_IN_SET('0', `pages`.`fe_group`)) OR (FIND_IN_SET('-1', `pages`.`fe_group`))))

Also, If I check my databank, tstamp: 1636985310 crdate: 1636705565 sys_lastchanged: 1636985310 I changed the sys_lanstchanged from 1636985310 to 0, but it hasn't changed anything.

And in sys_template in databank: include_static_file: EXT:fluid_styled_content/Configuration/TypoScript/,EXT:fluid_styled_content/Configuration/TypoScript/Styling/,EXT:mein_projektarbeit/Configuration/TypoScript

Maybe, it's not related to the content element anymore? Because another content elements which I made with a regular text element doesn't show up. The fully page doesn't show up on my website and any errors don't come up.

Thank you for your help.

CodePudding user response:

your configuration states:

lib.contentElement {
  templateRootPaths {
    100 = EXT:mein_projektarbeit/Resources/Private/Templates/
  }

your template file is at EXT:mein_projektarbeit/Resources/Private/Templates/ContentElements/

are you sure your templates are called with the complete relative path (ContentElements/NewContentElement)?

another reason for errors: do you have the correct spelling?

CodePudding user response:

Thank you everyone.

I found my mistake now! There ware no code in Default.html in \Resouces\Private\Layout\Page\Default.html. If I wrote my codes, the contents of NewContentElements.html is also shown up!

I'm so sorry for that and thank you all.

  • Related