최근 검색


최근 검색 없음

Rkuwornoo's Avatar

Rkuwornoo

가입한 날짜: 2021년 5월 28일

·

마지막 활동: 2022년 2월 02일

팔로잉

0

팔로워

0

총 활동 수

5

투표 수

0

가입 플랜

1

활동 개요

님의 최근 활동 Rkuwornoo

Rkuwornoo님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

Hi again,

OK so I solved it. I'm a part time developer so this can obviously be improved to ensure the attachment is an image before displaying but that's all secondary and a lot easier after getting the image to display in the first place. So here is my little contribution in case any one needs it. The same principle can be used to display any data field.

API HELP CENTER DOC

Thanks again guys.




댓글 보기 · 2016년 7월 07일에 게시됨 · Rkuwornoo

0

팔로워

0

투표 수

0

댓글


Rkuwornoo님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

Ok guys, so almost there, I can now get the URL of the attached image and display the URL in a div using JQUERY and AJAX. I am now trying to  get the URL into the src of an element by giving it an id. Any help would be appreciated.

This is my code below.

This must be run after:

{{#if promoted_articles}}
{{#each promoted_articles}}

in order to pick up the {{id}} of the article.

I should have an update by Monday but will keep checking to see if anyone has found a solution.

Cheers

 











댓글 보기 · 2016년 7월 07일에 게시됨 · Rkuwornoo

0

팔로워

0

투표 수

0

댓글


Rkuwornoo님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

@wes @Elliott, many thanks for having a look. I have been looking at the API and I almost have this resolved.

Using the API call below, I can see the attachment url.

GET /api/v2/help_center/articles/{article_id}/attachments.json

I now need to figure out how to grab it and use it to display the image. I'll update with my full code once complete.

Cheers.

댓글 보기 · 2016년 7월 07일에 게시됨 · Rkuwornoo

0

팔로워

0

투표 수

0

댓글


Rkuwornoo님이 에 댓글을 입력함

커뮤니티 댓글 Q&A - Help center and community

Hi all,

I'm very new to this so any help would be appreciated. I'm customizing a template and want to display an imaged attached to a Promoted Article on the Home Page. I can get the Promoted Article 'Title', 'URL' and 'EXCERPT' but can't seem to be able to access the attachment. This is what I have below:

{{#if promoted_articles}}

{{#each promoted_articles}}

{{#if attachments}}

{{/if}}

{{/each}}

{{/if}}

Does not seem to like the call for attachments and I'm not sure if this is just because it's on the home page or if I'm using it incorrectly. See attached image of what the final output should look like. All works except for the image. It would be great if we could check that the attachment is an image before displaying ELSE display a default image.

Many thanks again.

댓글 보기 · 2016년 6월 28일에 게시됨 · Rkuwornoo

0

팔로워

0

투표 수

0

댓글