Zum Inhalt springen

TypoScript - Meta Description aus dem Content

Erstellt am 8. März 2017 · 3 Antworten · letzte Antwort am 22. März 2017

Tags: TYPO3 6.x, Frage

bavramor ·

Hi, ich würde gerne aus dem 1 Beitrag der Spalte rechts den Text gecroppt in die Seiten Description packen. Ich habe es wie folgt probiert:

page.meta.description.ifEmpty.stdWrap.cObject = CONTENT 
page.meta.description.ifEmpty.stdWrap.cObject { 

  table = tt_content
  select {
    orderBy = sorting
    where = colPos=0
  }
  
}

Das Ergebnis ist nicht ganz verkehrt. Allerdings bekomme ich die Ganze Spalte nun mit HTML-Code und so angezeigt. Kann mir da jemand helfen?

Vielen Dank.

Bavra

Ausgabe des Description Feldes:

<meta name="description" content="<!--  CONTENT ELEMENT, uid:522/list [begin] -->
		<div id=&quot;c522&quot; class=&quot;csc-default&quot; >
		<!--  Header: [begin] -->
			<div class=&quot;csc-header csc-header-n1&quot;><h1 class=&quot; class=&quot;csc-firstHeader&quot;&quot;>Slider Bilder</h1></div>
		<!--  Header: [end] -->
			
		<!--  Plugin inserted: [begin] -->
			<div class=&quot;tx-imagecycle-pi1&quot;><ul id=&quot;imagecycle_c522&quot; class=&quot;tx-imagecycle-pi1-images&quot;><li><img src=&quot;typo3temp/_processed_/csm_Eiserfelder-Haus1_f9418a9e79.jpg&quot; width=&quot;598&quot; height=&quot;400&quot;   alt=&quot;&quot;  border=&quot;0&quot;></li><li><img src=&quot;typo3temp/_processed_/csm_Eiserfelder-Haus2_348fc803b6.jpg&quot; width=&quot;598&quot; height=&quot;400&quot;   alt=&quot;&quot;  border=&quot;0&quot;></li><li><img src=&quot;typo3temp/_processed_/csm_Eiserfelder-Haus3_113558bbcb.jpg&quot; width=&quot;598&quot; height=&quot;400&quot;   alt=&quot;&quot;  border=&quot;0&quot;></li><li><img src=&quot;typo3temp/_processed_/csm_Eiserfelder-Haus4_77275c1fb4.jpg&quot; width=&quot;598&quot; height=&quot;400&quot;   alt=&quot;&quot;  border=&quot;0&quot;></li><li><img src=&quot;typo3temp/_processed_/csm_Eiserfelder-Zimmer_c36bbe5263.jpg&quot; width=&quot;598&quot; height=&quot;400&quot;   alt=&quot;&quot;  border=&quot;0&quot;></li></ul></div><noscript><ul class=&quot;tx-imagecycle-pi1-images&quot;><li><img src=&quot;typo3temp/_processed_/csm_Eiserfelder-Haus1_f9418a9e79.jpg&quot; width=&quot;598&quot; height=&quot;400&quot;   alt=&quot;&quot;  border=&quot;0&quot;></li></ul></noscript>
		<!--  Plugin inserted: [end] -->
			</div>
	<!--  CONTENT ELEMENT, uid:522/list [end] -->
		
	<!--  CONTENT ELEMENT, uid:703/list [begin] -->
		<div id=&quot;c703&quot; class=&quot;csc-default&quot; >
		<!--  Plugin inserted: [begin] -->
			


	<!--

		BEGIN: Content of extension &quot;tab&quot;, plugin &quot;tx_tab_pi1&quot;

	-->
	<div class=&quot;tx-tab-pi1&quot;>
		<div class=&quot;tx-tab-bar&quot;>
<ul class=&quot;tx-tab-bar&quot; id=&quot;tx-tab-bar-703&quot;>
<li class=&quot;tx-tab-bar-item tx-tab-bar-item-selected&quot;>
<a class=&quot;tx-tab-bar-item tx-tab-bar-item-selected&quot; id=&quot;tx-tab-bar-703-0&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;tx_tab_tabClick('703','0','3')&quot;>
1-Zimmer-Appartement
</a>

</li>
<li class=&quot;tx-tab-bar-item&quot;>
<a class=&quot;tx-tab-bar-item&quot; id=&quot;tx-tab-bar-703-1&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;tx_tab_tabClick('703','1','3')&quot;>
Austattung
</a>

</li>
<li class=&quot;tx-tab-bar-item&quot;>
<a class=&quot;tx-tab-bar-item&quot; id=&quot;tx-tab-bar-703-2&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;tx_tab_tabClick('703','2','3')&quot;>
Lageplan
</a>

</li>

</ul>

</div>
<div class=&quot;tx-tab-panel-wrap&quot;>
<div class=&quot;tx-tab-panel&quot; id=&quot;tx-tab-panel-703&quot;>
<div class=&quot;tx-tab-panel-item&quot; id=&quot;tx-tab-panel-703-0&quot;>

	<!--  CONTENT ELEMENT, uid:535/textpic [begin] -->
		<div id=&quot;c535&quot; class=&quot;csc-default&quot; >
		<!--  Header: [begin] -->
			<div class=&quot;csc-header csc-header-n1&quot;><h1 class=&quot; class=&quot;csc-firstHeader&quot;&quot;>1-Zimmer-Appartement</h1></div>
		<!--  Header: [end] -->
			
		<!--  Image block: [begin] -->
			<div class=&quot;csc-textpic csc-textpic-center csc-textpic-above&quot;><div class=&quot;csc-textpic-imagewrap csc-textpic-single-image&quot; style=&quot;width:600px;&quot;><img src=&quot;typo3temp/_processed_/csm_BlumbergerGarten1_280d37d6a1.jpg&quot; width=&quot;600&quot; height=&quot;450&quot;   alt=&quot;&quot;  border=&quot;0&quot;></div><div class=&quot;csc-textpic-text&quot;>
		<!--  Text: [begin] -->
			<p class=&quot;bodytext&quot;>Die Mieter des Betreuten Wohnens mieten einen privaten Wohn- und Schlafraum sowie jeweils anteilig die Gemeinschaftsflächen an. Die Flächenanteile sowie die Kostenaufteilung wird in jedem Mietvertrag ausführlich dargestellt. <br /><br />In den Gemeinschaftsräumen werden täglich frisch gekochte Mahlzeiten angeboten. Die Gemeinschaft plant regelmäßige Feste und Veranstaltungen, deren Durchführung von den kompetenten Mitarbeitern der ambulanten Pflege maßgeblich unterstützt werden.</p>
		<!--  Text: [end] -->
			</div></div><div class=&quot;csc-textpic-clear&quot;><!-- --></div>
		<!--  Image block: [end] -->
			</div>
	<!--  CONTENT ELEMENT, uid:535/textpic [end] -->
		
</div>

<div class=&quot;tx-tab-panel-item&quot; id=&quot;tx-tab-panel-703-1&quot; style=&quot;display:none&quot;>

	<!--  CONTENT ELEMENT, uid:520/text [begin] -->
		<div id=&quot;c520&quot; class=&quot;csc-default&quot; >
		<!--  Header: [begin] -->
			<div class=&quot;csc-header csc-header-n1&quot;><h1 class=&quot; class=&quot;csc-firstHeader&quot;&quot;>Austattung</h1></div>
		<!--  Header: [end] -->
			
		<!--  Text: [begin] -->
			<p class=&quot;bodytext&quot;>Die 1-Raum-Wohnungen verfügen über Wohnflächen von durchschnittlich 27 m² mit Bad, Küche, Balkon und eigenem Keller. Die Wohnetage verfügt zusätzlich über Gemeinschaftsküchen, Wohnzimmer und großzügige Duschbäder und Waschmaschinenräume. Die Mietkosten liegen hierbei aktuell <b>zwischen 380,42 EUR bis 407,02 EUR Warmmiete</b> monatlich. </p>
		<!--  Text: [end] -->
			</div>
	<!--  CONTENT ELEMENT, uid:520/text [end] -->
		
</div>

<div class=&quot;tx-tab-panel-item&quot; id=&quot;tx-tab-panel-703-2&quot; style=&quot;display:none&quot;>

	<!--  CONTENT ELEMENT, uid:533/textpic [begin] -->
		<div id=&quot;c533&quot; class=&quot;csc-default&quot; >
		<!--  Header: [begin] -->
			<div class=&quot;csc-header csc-header-n1&quot;><h1 class=&quot; class=&quot;csc-firstHeader&quot;&quot;>Lageplan</h1></div>
		<!--  Header: [end] -->
			
		<!--  Image block: [begin] -->
			<div class=&quot;csc-textpic csc-textpic-center csc-textpic-above&quot;><div class=&quot;csc-textpic-imagewrap csc-textpic-single-image&quot; style=&quot;width:600px;&quot;><img src=&quot;typo3temp/_processed_/csm_BlumbergerGarten1_280d37d6a1.jpg&quot; width=&quot;600&quot; height=&quot;450&quot;   alt=&quot;&quot;  border=&quot;0&quot;></div><div class=&quot;csc-textpic-text&quot;></div></div><div class=&quot;csc-textpic-clear&quot;><!-- --></div>
		<!--  Image block: [end] -->
			</div>
	<!--  CONTENT ELEMENT, uid:533/textpic [end] -->
		
</div>

</div>

</div>

      <script type=&quot;text/javascript&quot;>
        /*<![CDATA[*/
        tx_tab_init();
        /*]]>*/
      </script>
      
	</div>
	
	<!-- END: Content of extension &quot;tab&quot;, plugin &quot;tx_tab_pi1&quot; -->

	
		<!--  Plugin inserted: [end] -->
			</div>
	<!--  CONTENT ELEMENT, uid:703/list [end] -->">
BastianBalthasarBux ·

das html und so müsstest du dann halt noch via parseFunc raushauen. kann aber recht schnell aufwändig werden.
und in der weiteren folge solltest du wohl auch prefixComments etc... abdrehen.