Jump to content

module, pw variables in js


diogo
 Share

Recommended Posts

Had this idea, but can't start working on it since I will go on vacations in some days. So, I just decided to throw it on the air and see if anyone will catch it ;)

Ok, the idea is to create a dynamic js file (or files) that would hold all usefull but not sensible data from a pw install.

The files could hold, not only, some config info like: url, images folder, styles folder, etc, but also some pages variables.

Here is the plan:

(very embrionary)

Config variables:

This one is easy. All no sensible info from the config file could go there.

Page data:

Each page object could hold the url of the page. This would make it easy for a method to find the right object for each page.

This page data could hold some chosen fields, the template, the children, the parent, etc...

Page data could be added to the file on page save.

Control:

There has to be a way of filtering the data that goes on the file. This could be done on a page by page basis, on a template basis, and on a field basis. I guess a checkbox on each of those should do the job.

Methods:

And why not mimic some PW methods also? Maybe even creating a jquery plugin. Would be nice for sure ;)

What do you think? Any major downside of doing something like this?

Link to comment
Share on other sites

This is something we had on the roadmap a long time ago back when it was just a forum thread. I think it's a good idea for sure. It would be nice to have the PW API fully available via javascript. It seems like there aren't many hurdles to overcome with it, at least to implement the $pages API variable for read-only access. It could use something like the Ajax page search API (but built for the front-end).

Link to comment
Share on other sites

:o never saw that thread! Or at least I don't remember...

Of course it would be great to have all that functionality coming from a ready file, instead of having to make a server call :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...