Noch kein Mitglied? Hier registrieren, um das Forum zu nutzen, News einzureichen, zu kommentieren oder Seiten in der Galerie einzustellen.
Vanilla 1.1.2 Forum von Lussumo. Weitere Informationen: Dokumentation, Community.
1 bis 18 von 18
@EVAL return $modx->runSnippet('getResources',array('parents'=>'999','tpl'=>'myOptionsItem'));
@EVAL return $modx->runSnippet('getResources',array('parents'=>'15','tpl'=>'auswahlListe','tplLast'=>'auswahlListeLast','sortby'=>'pagetitle','sortdir'=>'ASC'));
@SELECT pagetitle from site_content WHERE parent='15'
[[*myTV:pipes2comma]]
$search = "||";
$replace = ", "
$tv = str_replace($search, $replace, UNDwasKOMMThierHIN);
return $tv;
<?php
$search = "||";
$replace = ", ";
return str_replace($search, $replace, $input);
Input = 20||18||27
<ul>
[[meineLinks? &links=`[[*links]]`]]
</ul>
<li><a href="[[~[[+id]]]]">[[+titel]]</a></li>
Schau Dir die Docs an von Revo. Es ist alles so einfach mittlerweile. Du kommst an alle Daten wunderbar einfach ran. Siehe auch hier den Artikel vom Peter:
[[!Ditto? &documents=`[[*myTV]]`&tpl=`myLinkChunk`]]
<li><a href="[[~[[+id]]]]">[[+titel]]</a></li>
$id = $modx->resourceIdentifier;
$doc = $modx->getObject('modResource', $id);
$tvStilId = $doc->getTVValue('tvDynStilartenMusik');
$tvIdArray = explode('||', $tvStilId);
foreach($tvIdArray as $id2) {
$docs = $modx->getObject('modDocument', $id2);
$output[] = array('id' => $docs->get('id'), 'titel' => $docs->get('pagetitle'));
};
<a href="[[~[[+id]]]]">[[+titel]]</a>
Array ( [0] => Array ( [id] => 20 [titel] => Country ) [1] => Array ( [id] => 18 [titel] => Gospelmusik ) [2] => Array ( [id] => 27 [titel] => Heavy Metal ) )
$output[] = $modx->parseChunk('stil2link', array('id' => $docs->get('id'), 'titel' => $docs->get('pagetitle')));
Array ( [0] => Country [1] => Gospelmusik [2] => Heavy Metal )
Array
(
[0] => <a href="">Country</a>
[1] => <a href="">Gospelmusik</a>
[2] => <a href="">Heavy Metal</a>
)
Sieht jemand den Fehler?
$id = $modx->resourceIdentifier;
$doc = $modx->getObject('modResource', $id);
$tvStilId = $doc->getTVValue('tvDynStilartenMusik');
$tvIdArray = explode('||', $tvStilId);
foreach($tvIdArray as $id2) {
$docs = $modx->getObject('modDocument', $id2);
$docsId = $docs->get('id');
$docsTitle = $docs->get('pagetitle');
$link = '<a href="[[~'.$docsId.']]" title="'.$docsTitle.'">'.$docsTitle.'</a>, ';
echo $link;
};
Interpret (<a href="index.php?id=20" title="Country">Country</a>, <a href="index.php?id=18" title="Gospelmusik">Gospelmusik</a>, <a href="index.php?id=27" title="Heavy Metal">Heavy Metal</a>, )
$id = $modx->resourceIdentifier; // unnötig
$doc = $modx->getObject('modResource', $id); // unnötig
$tvStilId = $doc->getTVValue('tvDynStilartenMusik'); // unnötig
&Stile=`[[*tvDynStilartenMusik]]`
$tvIdArray = explode($Stile);
foreach($tvIdArray as $id2) {
$docs = $modx->getObject('modDocument', $id2);
$output .= $modx->parseChunk('stil2link',array('titel' => '$docs['pagetitle'],'id'=>'$docData['id']));
};
return $output;
$tvIdArray = explode('||', $Stile);
foreach($tvIdArray as $id2) {
$docs = $modx->getObject('modDocument', $id2);
$output .= $modx->parseChunk('stil2link',array('titel' => $docs['pagetitle'],'id' => $docs['id']));
};
echo $output;
Fatal error: Function name must be a string in D:\xampp\xampplite\htdocs\modxrevo\core\cache\elements\modsnippet\24.include.cache.php on line 15
<?php
//[[getDelimResources? &tpl=`mychunk` &pipelist=`[[*listTV]]` &delimiter=`, `]]
$delimiter = $modx->getOption('delimiter',$scriptProperties,',');
$tpl = $modx->getOption('tpl',$scriptProperties,'');
$pipelist = $modx->getOption('pipelist',$scriptProperties,'');
if ($tpl == '' || $pipelist == ''){return;}
$tvIdArray = explode('||', $pipelist);
foreach($tvIdArray as $docid) {
$resource = $modx->getObject('modDocument', $docid);
$output[] = $modx->getChunk($tpl,$resource->toArray());
};
return implode($delimiter,$output);
?>
1 bis 18 von 18