GithubHelp home page GithubHelp logo

servicepages's Introduction

ProcessWire Pages Web Service (ServicePages Module)

Enables ProcessWire-selector style $pages->find() queries via a web service. This web service is suitable for calling from Javascript/jQuery, PHP, etc. All output is generated in JSON format.

For the most part, you can do anything with this web service that you would do with a $pages->find() call. However, for security reasons, the limits of what can be searched and retrieved must be specified in the module configuration.

This module essentially provides a safe front-end to the AJAX API provided in the ProcessPageSearch module, enabling that capability to be used outside of the admin.

Once installed, this module creates a page called /service-pages/. View that page for detailed instructions and examples on how to use it.

servicepages's People

Contributors

ryancramerdesign avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

servicepages's Issues

Output Repeater values

I'm currently building an app using ProcessWire. I'm using the ServicePages module to expose my data as a REST-like API.

I'm also using the Repeater FieldType. However, the repeater field values aren't outputted in the API. Right now I'm only getting meta data for the repeater values:

reel_captions: [
    {
        id: 1060,
        parent_id: 1059,
        template: "repeater_reel_captions",
        name: "1468607646-89-1",
        path: "/processwire/repeaters/for-field-163/for-page-1/1468607646-89-1/",
        title: null
    }
]

How do I get the actual values outputted?

Posted this on StackOverflow as well.

Omit empty fields

If a field is empty, is there a way to emit it, so i don't get a response filled with null values like so:

{
    "selector": "template=reel, limit=25",
    "total": 1,
    "limit": 25,
    "start": 0,
    "matches": [{
        "id": 1,
        "parent_id": 0,
        "template": "reel",
        "path": "\/",
        "name": "home",
        "created": -62169955622,
        "modified": 1468539079,
        "title": "Reel",
        "body": null,
        "article_content": null,
        "article_gallery": null,
        "article_title": null
    }]
}

Tilde character in selector is sanitized

pages web service

The attached image pretty much says it all. Tilde (~) is supposed to be allowed in selector string but appears to be being sanitized to an underscore (_). I suspect a change to sanitizer, but just guessing.

(Applies to current stable 2.7.n)

Define displayFields per page/template

Braaw...

Currently each request ends in the "same" json output. Same properties, as defined under "Fields that will be included in results".

I think it would great, if we could define those fields for each page/template...

What do you think?

You do not have permission to execute this module

As mentioned on the forum:
https://processwire.com/talk/topic/1654-pages-web-service-servicepages/page-4

Adrian opened an issue here too on the main Processwire Github page:
ryancramerdesign/ProcessWire#520

There seems to be a bug in Modules.php at line 837, which does only allow superusers to view the output. I'd rather not edit the core as you can imagine, and this bug is preventing me to build an app that can pull info from PW. I hope you can take a look at it soon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.