최근 검색


최근 검색 없음

excerpt for promoted_articles



2024년 12월 23일에 게시됨

I am trying to get the excerpt for promoted_articles, but I get an error  not possible to access `article` in `article.body`. Added the code as in the excerpt-helper in the manual.

{{#each promoted_articles}}
   {{title}}
   {{url}}
   {{excerpt article.body characters=100}}
{{/each}}

{{title}} and {{url}} work. What am I doing wrong? 


0

4

댓글 4개

image avatar

Greg Katechis

Zendesk Developer Advocacy

Hi Alex!

 

I'm wondering if the issue is that you're already “inside of” the promoted_articles object and perhaps don't need to specify the `article` portion in the excerpt. If you haven't already, could you try using `{{excerpt body characters=100}}` and let me know the results?

0


Hi Greg Katechis ,

I found the same problem that Alex mentioned.  I also already tried using {{excerpt abody characters=100}} and the error is simply that ‘body’ doesn't exist.  I then tried this on an older template (V 2.xx) and it did work, so I wonder if something has broken with the new v4 template?

0


Same issue here. Would appreciate an update here, Greg. 

0


Hi @

 

Please, update your existing code with the code given below 

{{#each promoted_articles}}
   {{title}}
   {{url}}
   {{excerpt snippet characters=100}}
{{/each}}

The above code will solve your issue, if need any help please let me know

 

 

Thank You

Vishnuh

 

0


댓글을 남기려면 로그인하세요.

원하는 정보를 못 찾으셨나요?

새 게시물