Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Pod Page Url order? #2743

Closed
basepack opened this issue Feb 17, 2015 · 5 comments
Closed

Pod Page Url order? #2743

basepack opened this issue Feb 17, 2015 · 5 comments
Assignees

Comments

@basepack
Copy link

Hi,

I have build a custom api. With the following URL's:

/api/*
/api/*/*

However I have overridden one as follows:

/api/customers
/api/customers/*

You can already guessed it :-) Pods does not use /api/customers/* at all.
I have for example this request: /api/customers/121. Instead it requests /api//

I know you will add it to your todo list, but is there a small fix for it?

Edit: Pods version 2.5.1.1 (latest)
Also tested with Pods 2.4.3.

@Shelob9 Shelob9 added this to the Pods Future Release milestone Feb 17, 2015
@Shelob9 Shelob9 self-assigned this Feb 17, 2015
@Shelob9
Copy link
Contributor

Shelob9 commented Feb 17, 2015

I would actually not recommend having two different sets of pages. Instead I would have one set, but include a different WordPress Template for rendering the results with if the url has "customers" in it. You should be able to do this with the pods_page_template filter.

In the callback use parse_url() and see if "customers" is in the array that returns. If so change the return value, which is the path, relative to your theme/child theme for the template, which will be loaded using locate_template().

@basepack
Copy link
Author

Hi @Shelob9 ,

Nice solution to include a different template. But I think it would not pass down any HTTP headers?
The problem I see is that the /api/customers/* Pod Page needs the HTTP Header 'Authentication' to check the Bearer that the client sends with it from an Ajax POST call to it.

Excuse me for that complex sentence ;-)

But that is really my problem. I do not use any Wordpress page. I use only the Pod Page content.

@Shelob9
Copy link
Contributor

Shelob9 commented Feb 17, 2015

So why not do something similar, but return different page content using the pods_content filter?

@basepack
Copy link
Author

Hi, thank you,

I will try it tomorrow and place my findings here.

@Shelob9
Copy link
Contributor

Shelob9 commented Feb 17, 2015

Awesome. Please let us know how it works out. Would make for a great code example or tutorial.

@sc0ttkclark sc0ttkclark assigned jimtrue and unassigned Shelob9 Dec 29, 2015
@pods-framework pods-framework locked and limited conversation to collaborators Aug 11, 2022
@sc0ttkclark sc0ttkclark converted this issue into discussion #6614 Aug 11, 2022
@sc0ttkclark sc0ttkclark modified the milestones: Backlog, Backlog Archive Sep 11, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

4 participants