문제

I am converting an old mono-lingual site to a multi-lingual site with YAMS. I have a snippet including articles based on ID

$doc = $modx->getDocument($fromId, '*', 1); // Search published first.

Is there equivalent using YAMS? Like this where the language is based on current article?

$doc $modx-yamsGetDocument($fromId, '*', 1);

Any tips would be greatly appreciated!

도움이 되었습니까?

해결책

I'm not familiar with YAMS, but it looks like you need to run the YAMS snippet from within your code.

You should be able to do something like this:

$result = $modx->runSnippet('YAMS', array(
    'docid' => $fromId,
    // other parameters here
));

Consult the YAMS snippet documentation for a list of parameters to include.

다른 팁

I did this workaround, hope it helps somebody:

If you manage to bring the id of the language you could do this call:

$modx->runSnippet("getField", array('docid'=>$id_of_the_document,'field' =>'pagetitle_'.$lang));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top