I would like to create a custom widget for a Ghost Theme (https://ruby.ghost.io/) which I am working on.
The purpose of the widget is to display the first 12 words from a static page which I have already created within the site.
I’ve created the widget and it displays on my site, however, the text is hard coded - I would prefer that it pulls the words from the static page, as mentioned above.
This is my widget to date:
<div class="widget widget-tags u-shadow">
<h4 class="widget-title">About Me</h4>
<div>
<img src="{{asset 'images/myPhoto.png'}}" width="100" height="100" alt="My Photo" longdesc="Photograph of Me" style="display: block; margin-left: auto; margin-right: auto" />
</div>
<div> </div>
<div>
Hi! My name is Joe Bloggs and I am a professional
software developer.
</div>
All of my research on this area to date has shown me widgets associated with posts, but not static pages.
Any guidance or advice would be greatly appreciated.
When I say “static page” I mean a page I’ve created in Ghost Admin. I’ve now used the link you provided on the Content API, and was able to create a custom integration to use the API for GET /content/pages/{id}/ . All good.
Now I’m trying to use the Content API JavaScript Client Content API JavaScript Client to read the excerpt of the page.
I’ve got the following code, and I’m trying to assign the excerpt text to a div tag, but I can’t get it working.