Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Attachment requests fetch from the post endpoint #33

Open
goblindegook opened this issue Nov 2, 2014 · 4 comments
Open

Attachment requests fetch from the post endpoint #33

goblindegook opened this issue Nov 2, 2014 · 4 comments
Labels
Milestone

Comments

@goblindegook
Copy link
Member

Requesting a post attachment (for example, http://local.wordpress.dev/2013/03/tiled-gallery/attachment/man-of-steel), causes the application to attempt to GET /posts/b3:slug:man-of-steel instead of (the new) GET /media/b3:slug:man-of-steel.

@goblindegook goblindegook added this to the 1.0 milestone Nov 2, 2014
@pcruz7
Copy link
Contributor

pcruz7 commented Dec 9, 2014

Should this be shown as a post?

@goblindegook
Copy link
Member Author

Sort of like a post. There's a variety of content types (for image, video, audio, documents, etc.), the template should adapt to each.

@pcruz7
Copy link
Contributor

pcruz7 commented Dec 10, 2014

Another question: should these attachments be fetched upon click? E.g: the man of steel image has the following HTML

<div class="gallery-icon portrait">
     <a href="http://localhost:8888/wordpress/tiled-gallery/man-of-steel">
         <img width="150" height="150" src="http://localhost:8888/wordpress/wp-content/uploads/2013/03/man-of-steel-150x150.jpg" class="attachment-thumbnail" alt="Man Of Steel">
     </a>
</div>

The given HREF (http://localhost:8888/wordpress/tiled-gallery/man-of-steel) is not matching any of the given routes link (referring only to attachments):

           "attachment\/:attachment":{
               "object":"post",
               "type":"attachment",
               "tokens":[
                    "attachment"
               ]
            },
           ":post\/attachment\/:attachment":{
                "object":"post",
                "type":"attachment",
                "tokens":[
                    "post",
                    "attachment"
                ]
            },
           ":post\/attachment\/:attachment\/comments(\/page\/:paged)":{
                "object":"comments",
                "type":"attachment",
                "tokens":[
                    "post",
                    "attachment",
                    "paged"
                ]
            },
            "*page\/attachment\/:attachment":{
                "object":"post",
                "type":"attachment",
                "tokens":[
                    "page",
                    "attachment"
                ]
            },
            "*page\/attachment\/:attachment\/comments(\/page\/:paged)":{
                "object":"comments",
                "type":"attachment",
                "tokens":[
                    "page",
                    "attachment",
                    "paged"
                ]
            }

and following the idea of #28, wouldn't this affect SEO?

Another thing is, this HTML is not generated by us, but instead by Wordpress, so my second question is: how am I supposed to identify what is an attachment or what is not? If I allow the link to do its default behaviour the whole page will be reloaded - which is not our intention.

@goblindegook
Copy link
Member Author

Let's table this for now, we will probably have to write our own attachment templates using a consistent URL.

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

No branches or pull requests

2 participants