Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: make it work with wordpress rest api #19

Open
nanu-c opened this issue Nov 24, 2016 · 2 comments
Open

Enhancement: make it work with wordpress rest api #19

nanu-c opened this issue Nov 24, 2016 · 2 comments

Comments

@nanu-c
Copy link

nanu-c commented Nov 24, 2016

That could be quite easy and then put wp in a subdirectory and everyone can manage the content ;)

@bakercp
Copy link
Member

bakercp commented Nov 29, 2016

Hm -- not sure I understand the question / enhancement -- can you clarify?

@nanu-c
Copy link
Author

nanu-c commented Nov 30, 2016

okey, I stumbled upon your project and it has a really nice effect. At the moment the content is delivered from markup, but I thought with the Wordpress Rest API which outputs json and since everthing is js you can include a content management System easily. For example:
http://nanu-c.org/wp-json/wp/v2/posts/?filter[cat]=11

Behind "wp:featuredmedia" lies a image you can use for the effect and "content" for the content...
This was just a thought.

[

    {
        "id": 69,
        "date": "2014-02-09T17:57:15",
        "date_gmt": "2014-02-09T17:57:15",
        "guid": {
            "rendered": "http://nanu-c.org/?p=69"
        },
        "modified": "2016-09-27T21:02:55",
        "modified_gmt": "2016-09-27T20:02:55",
        "slug": "spaceinvaders-against-acab",
        "type": "post",
        "link": "http://nanu-c.org/2014/02/spaceinvaders-against-acab/",
        "title": {
            "rendered": "Spaceinvaders (for) ACAB"
        },
        "content": {
            "rendered": "<div style=\"width: 280px\" class=\"wp-caption alignright\"><img src=\"http://deserteursberatung.at/image/tn450x_603119772.png\" alt=\"\" width=\"270\" height=\"175\" /><p class=\"wp-caption-text\">Space Invaders Against Racism</p></div>\n<p>Als Vorbild hält dieser kleine Sticker, der Überall in der Stadt verteilt auf den Klos anzutreffen ist.</p>\n<p>Die Animation ist ACAB &#8211; (all colours are beautiful)</p>\n<p>&nbsp;</p>\n<p><a href=\"http://nanu-c.org/wp-content/uploads/2014/02/f2127232.jpg\"><img class=\"alignnone size-large wp-image-74\" src=\"http://nanu-c.org/wp-content/uploads/2014/02/f2127232-1024x768.jpg\" alt=\"f2127232\" width=\"660\" height=\"495\" /></a></p>\n<p><a href=\"http://nanu-c.org/wp-content/uploads/2014/02/f2130688.jpg\"><img class=\"alignnone size-medium wp-image-77\" src=\"http://nanu-c.org/wp-content/uploads/2014/02/f2130688-300x225.jpg\" alt=\"f2130688\" width=\"300\" height=\"225\" /></a> <a href=\"http://nanu-c.org/wp-content/uploads/2014/02/f2129536.jpg\"><img class=\"alignnone size-medium wp-image-76\" src=\"http://nanu-c.org/wp-content/uploads/2014/02/f2129536-300x225.jpg\" alt=\"f2129536\" width=\"300\" height=\"225\" /></a> <a href=\"http://nanu-c.org/wp-content/uploads/2014/02/f2128256.jpg\"><img class=\"alignnone size-medium wp-image-75\" src=\"http://nanu-c.org/wp-content/uploads/2014/02/f2128256-300x225.jpg\" alt=\"f2128256\" width=\"300\" height=\"225\" /></a></p>\n",
            "protected": false
        },
        "excerpt": {
            "rendered": "Als Vorbild hält dieser kleine Sticker, der Überall in der Stadt verteilt auf den Klos anzutreffen ist. Die Animation ist ACAB &#8211; (all colours are beautiful) &nbsp;",
            "protected": false
        },
        "author": 1,
        "featured_media": 74,
        "comment_status": "open",
        "ping_status": "open",
        "sticky": false,
        "format": "standard",
        "meta": { },
        "categories": [
            4,
            10,
            11
        ],
        "tags": [ ],
        "_links": {
            "self": [
                {
                    "href": "http://nanu-c.org/wp-json/wp/v2/posts/69"
                }
            ],
            "collection": [
                {
                    "href": "http://nanu-c.org/wp-json/wp/v2/posts"
                }
            ],
            "about": [
                {
                    "href": "http://nanu-c.org/wp-json/wp/v2/types/post"
                }
            ],
            "author": [
                {
                    "embeddable": true,
                    "href": "http://nanu-c.org/wp-json/wp/v2/users/1"
                }
            ],
            "replies": [
                {
                    "embeddable": true,
                    "href": "http://nanu-c.org/wp-json/wp/v2/comments?post=69"
                }
            ],
            "version-history": [
                {
                    "href": "http://nanu-c.org/wp-json/wp/v2/posts/69/revisions"
                }
            ],
            "wp:featuredmedia": [
                {
                    "embeddable": true,
                    "href": "http://nanu-c.org/wp-json/wp/v2/media/74"
                }
            ],
            "wp:attachment": [
                {
                    "href": "http://nanu-c.org/wp-json/wp/v2/media?parent=69"
                }
            ],
            "wp:term": [
                {
                    "taxonomy": "category",
                    "embeddable": true,
                    "href": "http://nanu-c.org/wp-json/wp/v2/categories?post=69"
                },
                {
                    "taxonomy": "post_tag",
                    "embeddable": true,
                    "href": "http://nanu-c.org/wp-json/wp/v2/tags?post=69"
                }
            ],
            "curies": [
                {
                    "name": "wp",
                    "href": "https://api.w.org/{rel}",
                    "templated": true
                }
            ]
        }
    }

]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants