Skip to content

Instantly share code, notes, and snippets.

@tim-bec
Last active December 18, 2015 02:29
Show Gist options
  • Save tim-bec/5711780 to your computer and use it in GitHub Desktop.
Save tim-bec/5711780 to your computer and use it in GitHub Desktop.
Referenziertes MetaModel laden und daraus einen Translatedtext (introduction) abrufen, kürzen, abschneiden und ausgeben.
<?php
#Vorbereiten
$longtext = MetaModelFactory::byTableName('mm_projects')->findById($arrItem['raw']['project']['id'])->get('introduction');
# Longtext an string übergeben
$string = $longtext['value'];
$string = (strlen($string) > 123) ? substr($string,0,120).'...' : $string;
echo $string;
?>
@andreasisaak
Copy link

This is the short variant ;)

https://gist.github.com/andreasisaak/5712103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment