Fixing homepage changes
This commit is contained in:
parent
6aafb9e6da
commit
d582eb9919
15
README.md
15
README.md
@ -4,6 +4,7 @@
|
||||
|
||||
* 100% Mobile responsive
|
||||
* Supports GitHub Flavored Markdown
|
||||
* Auto created homepage/landing page
|
||||
* Auto Syntax Highlighting
|
||||
* Auto Generated Navigation
|
||||
* 4 Built-In Themes or roll your own
|
||||
@ -19,7 +20,7 @@ This is a list of sites using Daux.io:
|
||||
|
||||
* [TodayCMS Docs](http://docs.todaymade.com)
|
||||
|
||||
Do you use Daux.io? Send me a pull request or open an [issue](https://github.com/justinwalsh/tm-docs/issues) and I will add you to the list.
|
||||
Do you use Daux.io? Send me a pull request or open an [issue](https://github.com/justinwalsh/daux.io/issues) and I will add you to the list.
|
||||
|
||||
## Download
|
||||
|
||||
@ -88,7 +89,7 @@ We have 4 built-in Bootstrap themes. To use one of the themes, just set the `the
|
||||
To create a custom color scheme, set the `theme` property to `custom` and then define the required colors. Copy the following configuration to get started:
|
||||
|
||||
{
|
||||
"theme": "custom"
|
||||
"theme": "custom",
|
||||
"colors": {
|
||||
"sidebar-background": "#f7f7f7",
|
||||
"sidebar-hover": "#c5c5cb",
|
||||
@ -115,7 +116,7 @@ By deafult your code blocks will be floated to a column on the right side of you
|
||||
Add a 'Fork me on Github' ribbon.
|
||||
|
||||
{
|
||||
"repo": "justinwalsh/tm-docs"
|
||||
"repo": "justinwalsh/daux.io"
|
||||
}
|
||||
|
||||
###Twitter:
|
||||
@ -130,9 +131,9 @@ Include custom links in the sidebar.
|
||||
|
||||
{
|
||||
"links": {
|
||||
"Github Repo": "https://github.com/justinwalsh/tm-docs",
|
||||
"Help/Support/Bugs": "https://github.com/justinwalsh/tm-docs/issues",
|
||||
"Todaymade": "http://todaymade.com"
|
||||
"Github Repo": "https://github.com/justinwalsh/daux.io",
|
||||
"Help/Support/Bugs": "https://github.com/justinwalsh/daux.io/issues",
|
||||
"Made by Todaymade": "http://todaymade.com"
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,4 +152,4 @@ This project contains a package.json file, so once you have the requirements ins
|
||||
|
||||
## Support
|
||||
|
||||
If you need help using Daux.io, or have found a bug, please create an issue on the <a href="https://github.com/justinwalsh/tm-docs/issues" target="_blank">Github repo</a>.
|
||||
If you need help using Daux.io, or have found a bug, please create an issue on the <a href="https://github.com/justinwalsh/daux.io/issues" target="_blank">Github repo</a>.
|
@ -20,7 +20,7 @@ This is a list of sites using Daux.io:
|
||||
|
||||
* [TodayCMS Docs](http://docs.todaymade.com)
|
||||
|
||||
Do you use Daux.io? Send me a pull request or open an [issue](https://github.com/justinwalsh/tm-docs/issues) and I will add you to the list.
|
||||
Do you use Daux.io? Send me a pull request or open an [issue](https://github.com/justinwalsh/daux.io/issues) and I will add you to the list.
|
||||
|
||||
## Download
|
||||
|
||||
@ -48,7 +48,6 @@ You must use the `.md` file extension for your files. Also, you must use undersc
|
||||
|
||||
* File Name With Space.md = FAIL
|
||||
|
||||
|
||||
## Sorting
|
||||
|
||||
To sort your files and folders in a specific way, you can prefix them with a number and underscore, e.g. `/docs/01_Hello_World.md` and `/docs/05_Features.md` This will list *Hello World* before *Features*, overriding the deafult alpha-numeric sorting. The numbers will be stripped out of the navigation and urls.
|
||||
@ -116,7 +115,7 @@ By deafult your code blocks will be floated to a column on the right side of you
|
||||
Add a 'Fork me on Github' ribbon.
|
||||
|
||||
{
|
||||
"repo": "justinwalsh/tm-docs"
|
||||
"repo": "justinwalsh/daux.io"
|
||||
}
|
||||
|
||||
###Twitter:
|
||||
@ -131,9 +130,9 @@ Include custom links in the sidebar.
|
||||
|
||||
{
|
||||
"links": {
|
||||
"Github Repo": "https://github.com/justinwalsh/tm-docs",
|
||||
"Help/Support/Bugs": "https://github.com/justinwalsh/tm-docs/issues",
|
||||
"Todaymade": "http://todaymade.com"
|
||||
"Github Repo": "https://github.com/justinwalsh/daux.io",
|
||||
"Help/Support/Bugs": "https://github.com/justinwalsh/daux.io/issues",
|
||||
"Made by Todaymade": "http://todaymade.com"
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,4 +151,4 @@ This project contains a package.json file, so once you have the requirements ins
|
||||
|
||||
## Support
|
||||
|
||||
If you need help using Daux.io, or have found a bug, please create an issue on the <a href="https://github.com/justinwalsh/tm-docs/issues" target="_blank">Github repo</a>.
|
||||
If you need help using Daux.io, or have found a bug, please create an issue on the <a href="https://github.com/justinwalsh/daux.io/issues" target="_blank">Github repo</a>.
|
@ -1,31 +0,0 @@
|
||||
The following collection config will be used as the config throughout the example calls in this guide.
|
||||
|
||||
{
|
||||
"team": {
|
||||
"title": "Team Members",
|
||||
"type": "multiple",
|
||||
"fields": {
|
||||
"name": {
|
||||
"title": "Name",
|
||||
"type": "text"
|
||||
},
|
||||
"employment": {
|
||||
"title": "Employment Status",
|
||||
"type": "select",
|
||||
"options": {
|
||||
"half": "Part Time",
|
||||
"full": "Full Time",
|
||||
"retired": "Retired"
|
||||
}
|
||||
},
|
||||
"bio": {
|
||||
"title": "Bio",
|
||||
"type": "textarea"
|
||||
},
|
||||
"address": {
|
||||
"title": "Home Address",
|
||||
"type": "location"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
To create an object in a collection, issue a HTTP POST call with the object in the body of the POST.
|
||||
|
||||
POST /collections/:collection
|
||||
|
||||
**URL Parameters**
|
||||
|
||||
`:collection` is the key of the collection in the config.
|
||||
|
||||
**Example**
|
||||
|
||||
POST /collections/team
|
||||
|
||||
name = Justin
|
||||
employment = full
|
||||
bio = Node.js developer
|
||||
address[city] = Bismarck
|
||||
address[state] = ND
|
||||
address[zip] = 58501
|
||||
...
|
||||
|
||||
Note: 'team' is the key used in our example config at the top of this guide
|
||||
|
||||
**Returns**
|
||||
|
||||
The object you just created.
|
@ -1,12 +0,0 @@
|
||||
To read from a collection, issue a HTTP GET call
|
||||
|
||||
GET /collections/:collection
|
||||
|
||||
|
||||
**URL Parameters**
|
||||
|
||||
`:collection` is the key of the collection in the config.
|
||||
|
||||
**Returns**
|
||||
|
||||
An array of objects from the collection.
|
@ -1,18 +0,0 @@
|
||||
To update an object in a collection, issue a HTTP POST call with the object in the body of the POST.
|
||||
|
||||
POST /collections/:collection/:id
|
||||
|
||||
name = Justin Walsh
|
||||
employment = part
|
||||
bio = Documention writer
|
||||
...
|
||||
|
||||
**URL Parameters**
|
||||
|
||||
`:collection` is the key of the collection in the config.
|
||||
|
||||
`:id` is the id of the object you want to update.
|
||||
|
||||
**Returns**
|
||||
|
||||
The object you just updated.
|
@ -1 +0,0 @@
|
||||
Coming Soon
|
156
docs/01_Examples/01_GitHub_Flavored_Markdown.md
Normal file
156
docs/01_Examples/01_GitHub_Flavored_Markdown.md
Normal file
@ -0,0 +1,156 @@
|
||||
Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:
|
||||
|
||||
Roses are red
|
||||
Violets are blue
|
||||
|
||||
The next paragraph has the same phrases, but now they are separated by two spaces and a newline character:
|
||||
|
||||
Roses are red
|
||||
Violets are blue
|
||||
|
||||
Oh, and one thing I cannot stand is the mangling of words with multiple underscores in them like perform_complicated_task or do_this_and_do_that_and_another_thing.
|
||||
|
||||
A bit of the GitHub spice
|
||||
-------------------------
|
||||
|
||||
In addition to the changes in the previous section, certain references are auto-linked:
|
||||
|
||||
* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
|
||||
* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
|
||||
* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
|
||||
* \#Num: #1
|
||||
* User/#Num: mojombo#1
|
||||
* User/Project#Num: mojombo/god#1
|
||||
|
||||
These are dangerous goodies though, and we need to make sure email addresses don't get mangled:
|
||||
|
||||
My email addy is tom@github.com.
|
||||
|
||||
Math is hard, let's go shopping
|
||||
-------------------------------
|
||||
|
||||
In first grade I learned that 5 > 3 and 2 < 7. Maybe some arrows. 1 -> 2 -> 3. 9 <- 8 <- 7.
|
||||
|
||||
Triangles man! a^2 + b^2 = c^2
|
||||
|
||||
We all like making lists
|
||||
------------------------
|
||||
|
||||
The above header should be an H2 tag. Now, for a list of fruits:
|
||||
|
||||
* Red Apples
|
||||
* Purple Grapes
|
||||
* Green Kiwifruits
|
||||
|
||||
Let's get crazy:
|
||||
|
||||
1. This is a list item with two paragraphs. Lorem ipsum dolor
|
||||
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
|
||||
mi posuere lectus.
|
||||
|
||||
Vestibulum enim wisi, viverra nec, fringilla in, laoreet
|
||||
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
|
||||
sit amet velit.
|
||||
|
||||
2. Suspendisse id sem consectetuer libero luctus adipiscing.
|
||||
|
||||
What about some code **in** a list? That's insane, right?
|
||||
|
||||
1. In Ruby you can map like this:
|
||||
|
||||
['a', 'b'].map { |x| x.uppercase }
|
||||
|
||||
2. In Rails, you can do a shortcut:
|
||||
|
||||
['a', 'b'].map(&:uppercase)
|
||||
|
||||
Some people seem to like definition lists
|
||||
|
||||
<dl>
|
||||
<dt>Lower cost</dt>
|
||||
<dd>The new version of this product costs significantly less than the previous one!</dd>
|
||||
<dt>Easier to use</dt>
|
||||
<dd>We've changed the product so that it's much easier to use!</dd>
|
||||
</dl>
|
||||
|
||||
I am a robot
|
||||
------------
|
||||
|
||||
Maybe you want to print `robot` to the console 1000 times. Why not?
|
||||
|
||||
def robot_invasion
|
||||
puts("robot " * 1000)
|
||||
end
|
||||
|
||||
You see, that was formatted as code because it's been indented by four spaces.
|
||||
|
||||
How about we throw some angle braces and ampersands in there?
|
||||
|
||||
<div class="footer">
|
||||
© 2004 Foo Corporation
|
||||
</div>
|
||||
|
||||
Set in stone
|
||||
------------
|
||||
|
||||
Preformatted blocks are useful for ASCII art:
|
||||
|
||||
<pre>
|
||||
,-.
|
||||
, ,-. ,-.
|
||||
/ \ ( )-( )
|
||||
\ | ,.>-( )-<
|
||||
\|,' ( )-( )
|
||||
Y ___`-' `-'
|
||||
|/__/ `-'
|
||||
|
|
||||
|
|
||||
| -hrr-
|
||||
___|_____________
|
||||
</pre>
|
||||
|
||||
Playing the blame game
|
||||
----------------------
|
||||
|
||||
If you need to blame someone, the best way to do so is by quoting them:
|
||||
|
||||
> I, at any rate, am convinced that He does not throw dice.
|
||||
|
||||
Or perhaps someone a little less eloquent:
|
||||
|
||||
> I wish you'd have given me this written question ahead of time so I
|
||||
> could plan for it... I'm sure something will pop into my head here in
|
||||
> the midst of this press conference, with all the pressure of trying to
|
||||
> come up with answer, but it hadn't yet...
|
||||
>
|
||||
> I don't want to sound like
|
||||
> I have made no mistakes. I'm confident I have. I just haven't - you
|
||||
> just put me under the spot here, and maybe I'm not as quick on my feet
|
||||
> as I should be in coming up with one.
|
||||
|
||||
Table for two
|
||||
-------------
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>ID</th><th>Name</th><th>Rank</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td><td>Tom Preston-Werner</td><td>Awesome</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td><td>Albert Einstein</td><td>Nearly as awesome</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Crazy linking action
|
||||
--------------------
|
||||
|
||||
I get 10 times more traffic from [Google] [1] than from
|
||||
[Yahoo] [2] or [MSN] [3].
|
||||
|
||||
[1]: http://google.com/ "Google"
|
||||
[2]: http://search.yahoo.com/ "Yahoo Search"
|
||||
[3]: http://search.msn.com/ "MSN Search"
|
||||
|
||||
*View the [source of this content](http://github.github.com/github-flavored-markdown/sample_content.html).*
|
@ -1,41 +0,0 @@
|
||||
A config object that contains other objects (admin sections) and displays them in a group.
|
||||
|
||||
Parent elements are characterized by a subhead in the admin panel navigation. They also group elements in the [[Outline (call)]].
|
||||
|
||||
{
|
||||
"sample_parent": {
|
||||
"title": "Sample Parent",
|
||||
"type": "parent"
|
||||
}
|
||||
}
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Default | Description |
|
||||
| :------------- | :------------- | :------------- |
|
||||
| title | required | Descriptive title of the object. This value will be used to identify the object in the admin panel sidebar navigation. Required field. |
|
||||
| type | parent | Object identifier. Required, must be set to: 'parent' |
|
||||
|
||||
### Single
|
||||
The Single object is created in the config.json file. This will create a single page that can be edited in the admin panel and displayed on the front end.
|
||||
|
||||
{
|
||||
"single-name": {
|
||||
"title": "single-title",
|
||||
"parent": "sample_parent",
|
||||
"type": "single",
|
||||
"fields": {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Default | Description |
|
||||
| :------------- | :------------- | :------------- |
|
||||
| title | required | Descriptive title of the page. This value will be used to identify the object in the admin panel sidebar navigation. Required field. |
|
||||
| type | single | Object identifier. Required, must be set to: 'single.' |
|
||||
| parent | - | Defines parent container object. Allows you to group multiple objects together in the admin panel (like a folder). |
|
||||
| nav | true | Allows you to hide or show object elements in the admin panel. |
|
||||
|
@ -1,99 +0,0 @@
|
||||
There are several customizations that can be made to the 'cms_setup' function.
|
||||
|
||||
##id
|
||||
Used to update an existing record.
|
||||
|
||||
<script type='text/javascript'>
|
||||
cms_setup({
|
||||
apikey: '7DdPrtGp9ZhKmk',
|
||||
collection: "listings",
|
||||
id: 12345
|
||||
});
|
||||
</script>
|
||||
|
||||
##config
|
||||
Overrides the collections configuration for only this editor.
|
||||
|
||||
In this example we are changing the visibility of the account field:
|
||||
|
||||
<script type='text/javascript'>
|
||||
cms_setup({
|
||||
apikey: '7DdPrtGp9ZhKmk',
|
||||
collection: "listings",
|
||||
config: {
|
||||
fields: {
|
||||
account: {
|
||||
hidden:true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
##data
|
||||
Overrides the data for this object
|
||||
|
||||
<script type='text/javascript'>
|
||||
cms_setup({
|
||||
apikey: '7DdPrtGp9ZhKmk',
|
||||
collection: "listings",
|
||||
data: {
|
||||
account: 12345
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
##before_save
|
||||
Function that is called before the object is saved to the api. It recieves a complete json copy of the object. Use this to make any modifications to the object before it is saved. If you return false, the save will be canceled, this is usefully for valdation errors.
|
||||
|
||||
<script type='text/javascript'>
|
||||
cms_setup({
|
||||
apikey: '7DdPrtGp9ZhKmk',
|
||||
collection: "listings",
|
||||
before_save: function(object) {
|
||||
if (object.first_name === '') {
|
||||
alert('Please enter a first name.');
|
||||
return false;
|
||||
} else {
|
||||
return object;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
##after_save
|
||||
Function that is called after the object has been saved. It recieves a complete json copy of the object that was just saved to the database.
|
||||
|
||||
<script type='text/javascript'>
|
||||
cms_setup({
|
||||
apikey: '7DdPrtGp9ZhKmk',
|
||||
collection: "listings",
|
||||
after_save: function(object) {
|
||||
window.location = "/account/listings/" + object.id;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
##bootstrap
|
||||
Enable or disable the bootstrap css. Useful if bootstrap has already been loaded on the page.
|
||||
|
||||
<script type='text/javascript'>
|
||||
cms_setup({
|
||||
apikey: '7DdPrtGp9ZhKmk',
|
||||
collection: "listings",
|
||||
bootstrap: false
|
||||
});
|
||||
</script>
|
||||
|
||||
##theme
|
||||
Sets the theme. Availible themes: light or dark. The light theme is the default. Use false to disable the theme css.
|
||||
|
||||
<script type='text/javascript'>
|
||||
cms_setup({
|
||||
apikey: '7DdPrtGp9ZhKmk',
|
||||
collection: "listings",
|
||||
theme: false,
|
||||
// or
|
||||
// theme: 'dark'
|
||||
});
|
||||
</script>
|
@ -1,3 +0,0 @@
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut dictum arcu ultrices justo adipiscing in euismod eros bibendum. Praesent sed tellus massa. Nulla accumsan malesuada nibh, id scelerisque tortor hendrerit ut. Curabitur tellus odio, fringilla at laoreet ac, ullamcorper non diam. Vestibulum faucibus, mauris at iaculis lacinia, ante tellus aliquam dui, eu aliquet lectus nulla sed mi. Aliquam eu felis sed orci aliquam gravida.
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut dictum arcu ultrices justo adipiscing in euismod eros bibendum. Praesent sed tellus massa.
|
@ -1,5 +0,0 @@
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut dictum arcu ultrices justo adipiscing in euismod eros bibendum. Praesent sed tellus massa.
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut dictum arcu ultrices justo adipiscing in euismod eros bibendum. Praesent sed tellus massa. Nulla accumsan malesuada nibh, id scelerisque tortor hendrerit ut. Curabitur tellus odio, fringilla at laoreet ac, ullamcorper non diam. Vestibulum faucibus, mauris at iaculis lacinia, ante tellus aliquam dui, eu aliquet lectus nulla sed mi. Aliquam eu felis sed orci aliquam gravida. Ut aliquam velit commodo mauris molestie in accumsan lacus iaculis. Pellentesque at sodales leo.
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut dictum arcu ultrices justo adipiscing in euismod eros bibendum. Praesent sed tellus massa. Nulla accumsan malesuada nibh, id scelerisque tortor hendrerit ut. Curabitur tellus odio, fringilla at laoreet ac, ullamcorper non diam. Vestibulum faucibus, mauris at iaculis lacinia, ante tellus aliquam dui, eu aliquet lectus nulla sed mi. Aliquam eu felis sed orci aliquam gravida.
|
1
docs/05_More_Examples/Hello_World.md
Normal file
1
docs/05_More_Examples/Hello_World.md
Normal file
@ -0,0 +1 @@
|
||||
THis is just another sample page to get you started.
|
15
docs/cms/01_API/00_Overview.md
Normal file
15
docs/cms/01_API/00_Overview.md
Normal file
@ -0,0 +1,15 @@
|
||||
## Introduction
|
||||
|
||||
:TODO
|
||||
|
||||
## Architecture
|
||||
|
||||
:TODO
|
||||
|
||||
## Formatting
|
||||
|
||||
:TODO
|
||||
|
||||
## Requests and Responses
|
||||
|
||||
:TODO
|
@ -18,6 +18,10 @@ The following collection config will be used as the config throughout the exampl
|
||||
"retired": "Retired"
|
||||
}
|
||||
},
|
||||
"age": {
|
||||
"title": "Age",
|
||||
"type": "text"
|
||||
},
|
||||
"bio": {
|
||||
"title": "Bio",
|
||||
"type": "textarea"
|
@ -2,11 +2,11 @@ To create an object in a collection, issue a HTTP POST call with the object in t
|
||||
|
||||
POST /collections/:collection
|
||||
|
||||
**URL Parameters**
|
||||
##URL Parameters
|
||||
|
||||
`:collection` is the key of the collection in the config.
|
||||
|
||||
**Example**
|
||||
##Example
|
||||
|
||||
POST /collections/team
|
||||
|
||||
@ -20,6 +20,6 @@ To create an object in a collection, issue a HTTP POST call with the object in t
|
||||
|
||||
Note: 'team' is the key used in our example config at the top of this guide
|
||||
|
||||
**Returns**
|
||||
##Returns
|
||||
|
||||
The object you just created.
|
54
docs/cms/01_API/15_Read.md
Normal file
54
docs/cms/01_API/15_Read.md
Normal file
@ -0,0 +1,54 @@
|
||||
To read all objects from a collection, issue a HTTP GET call
|
||||
|
||||
Entire Collection:
|
||||
|
||||
GET /collections/:collection
|
||||
|
||||
Single Object:
|
||||
|
||||
GET /collections/:collection/:id
|
||||
|
||||
|
||||
### URL Parameters
|
||||
|
||||
`:collection` is the key of the collection in the config.
|
||||
`:id` [optional]: is the id of an object in the collection.
|
||||
|
||||
### Query Parameters
|
||||
|
||||
All query parameters are optional.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `slug` | String | Find record with the matching slug |
|
||||
| `filter` | JSON Object | Filters the results - [Read More about Filtering](/API/Filtering) |
|
||||
| `sort` | JSON Object | Sorts the results - [Read More about Sorting](/API/Sorting) |
|
||||
| `limit` | Integer | Limit the number of results |
|
||||
| `offset` | Integer | Offset the results |
|
||||
| `count` | Boolean | Returns the count of matching records |
|
||||
|
||||
### Paging
|
||||
|
||||
To page the results, use the `limit` and `offset` parameters together. For example, if you wanted to page your results 20 at a time and you want the 3rd page of results, you would make the following call:
|
||||
|
||||
GET /collections/:collection?limit=20&offset=40
|
||||
|
||||
This would return results 41-60 from your collection
|
||||
|
||||
### Count
|
||||
|
||||
To only recieve the number of results that match the get request, you can send the optional `count` paramenter. This is helpful for finding the number of matches for a filter, or other types of linear data.
|
||||
|
||||
Example Call:
|
||||
|
||||
GET /collections/:collection?count=true
|
||||
|
||||
Returns:
|
||||
|
||||
{
|
||||
"count": 47
|
||||
}
|
||||
|
||||
### Returns
|
||||
|
||||
An array of objects from the collection.
|
27
docs/cms/01_API/20_Update.md
Normal file
27
docs/cms/01_API/20_Update.md
Normal file
@ -0,0 +1,27 @@
|
||||
To update an object in a collection, issue a HTTP `PUT` call with the object in the body of the POST.
|
||||
|
||||
PUT /collections/:collection/:id
|
||||
|
||||
name = Justin Walsh
|
||||
employment = part
|
||||
bio = Documention writer
|
||||
...
|
||||
|
||||
### URL Parameters
|
||||
|
||||
`:collection` is the key of the collection in the config.
|
||||
|
||||
`:id` is the id of the object you want to update.
|
||||
|
||||
|
||||
### Query Parameters
|
||||
|
||||
All query parameters are optional.
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `overwrite` | Boolean | `false` | Setting this to `true` will force the server to completely overwrite the object in the database instead of doing a partial update |
|
||||
|
||||
### Returns
|
||||
|
||||
The object you just updated.
|
13
docs/cms/01_API/25_Delete.md
Normal file
13
docs/cms/01_API/25_Delete.md
Normal file
@ -0,0 +1,13 @@
|
||||
To delete an object in a collection, issue a HTTP `DELETE` call with the id of the object you wish to delete in the url.
|
||||
|
||||
DELETE /collections/:collection/:id
|
||||
|
||||
**URL Parameters**
|
||||
|
||||
`:collection` is the key of the collection in the config.
|
||||
|
||||
`:id` is the id of the object you want to delete.
|
||||
|
||||
**Returns**
|
||||
|
||||
The object you just deleted.
|
28
docs/cms/01_API/35_Sorting.md
Normal file
28
docs/cms/01_API/35_Sorting.md
Normal file
@ -0,0 +1,28 @@
|
||||
To filter an api call, send the optional `sort` parameter. The sort parameter is a structured json object.
|
||||
|
||||
## Structure
|
||||
|
||||
The sort object is a simple `{"key": "direction"}` json object. The key is the field you wish to sort by. The direction is which order to sort the field by. The only two values you can use for the direction are `asc` and `desc`.
|
||||
|
||||
{
|
||||
"field_key": "direction"
|
||||
}
|
||||
|
||||
*Example Call:*
|
||||
|
||||
GET /collections/team?sort={"name":"asc"}
|
||||
|
||||
## Multiple Fields
|
||||
|
||||
This structure allows you to sort by more then one field at a time.
|
||||
|
||||
{
|
||||
"field key": "direction",
|
||||
"field key 2": "direction",
|
||||
"field key 2": "direction"
|
||||
...
|
||||
}
|
||||
|
||||
*Example Call:*
|
||||
|
||||
GET /collections/team?sort={"age":"desc", "name":"asc"}
|
17
docs/cms/05_Config/01_Parent.md
Normal file
17
docs/cms/05_Config/01_Parent.md
Normal file
@ -0,0 +1,17 @@
|
||||
A config object that contains other objects (admin sections) and displays them in a group.
|
||||
|
||||
Parent elements are characterized by a subhead in the admin panel navigation. They also group elements in the [[Outline (call)]].
|
||||
|
||||
{
|
||||
"sample_parent": {
|
||||
"title": "Sample Parent",
|
||||
"type": "parent"
|
||||
}
|
||||
}
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Default | Description |
|
||||
| :------------- | :------------- | :------------- |
|
||||
| title | required | Descriptive title of the object. This value will be used to identify the object in the admin panel sidebar navigation. Required field. |
|
||||
| type | parent | Object identifier. Required, must be set to: 'parent' |
|
@ -43,36 +43,8 @@ Overrides the data for this object
|
||||
});
|
||||
</script>
|
||||
|
||||
##before_save
|
||||
Function that is called before the object is saved to the api. It recieves a complete json copy of the object. Use this to make any modifications to the object before it is saved. If you return false, the save will be canceled, this is usefully for valdation errors.
|
||||
|
||||
<script type='text/javascript'>
|
||||
cms_setup({
|
||||
apikey: '7DdPrtGp9ZhKmk',
|
||||
collection: "listings",
|
||||
before_save: function(object) {
|
||||
if (object.first_name === '') {
|
||||
alert('Please enter a first name.');
|
||||
return false;
|
||||
} else {
|
||||
return object;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
##after_save
|
||||
Function that is called after the object has been saved. It recieves a complete json copy of the object that was just saved to the database.
|
||||
|
||||
<script type='text/javascript'>
|
||||
cms_setup({
|
||||
apikey: '7DdPrtGp9ZhKmk',
|
||||
collection: "listings",
|
||||
after_save: function(object) {
|
||||
window.location = "/account/listings/" + object.id;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
##callbacks
|
||||
[Learn more](/Editor/Callbacks) about callbacks you can use to hook into the processing of the editor.
|
||||
|
||||
##bootstrap
|
||||
Enable or disable the bootstrap css. Useful if bootstrap has already been loaded on the page.
|
73
docs/cms/10_Editor/10_Callbacks.md
Normal file
73
docs/cms/10_Editor/10_Callbacks.md
Normal file
@ -0,0 +1,73 @@
|
||||
There are several callbacks availible to hook into the editors processing.
|
||||
|
||||
## Structure
|
||||
|
||||
All callbacks use the same basic structure:
|
||||
|
||||
<script type='text/javascript'>
|
||||
cms_setup({
|
||||
apikey: '7DdPrtGp9ZhKmk',
|
||||
collection: "listings",
|
||||
before_save: function(object, next) {
|
||||
if (object.first_name === '' || object.first_name === undefined) {
|
||||
alert('Please enter a first name.');
|
||||
next(false);
|
||||
} else {
|
||||
next(object);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
## Parameters
|
||||
|
||||
A callback must accept these two parameters:
|
||||
|
||||
`object` - a copy of the data that is about to be saved, or was just saved.
|
||||
`next` - a function that must be called after your code is finished to continue processing the request.
|
||||
|
||||
You must with call `next(object);` to continue or `next(false);` to cancel the request.
|
||||
|
||||
## Before Callbacks
|
||||
|
||||
Before callbacks are fired before anything is sent to the server to be saved. Use these callbacks to valid user imput, or load remote data and merge it into the object before saving. You can cancel the save completly by calling `next(false);`
|
||||
|
||||
| Name | On | Description |
|
||||
| :--- | :--- | :--- |
|
||||
| before_create | create | Called before creating a new object in a collection. |
|
||||
| before_update | update | Called before updating an existing object in a collection. |
|
||||
| before_save | create or update | Called before saving any object in a collection. |
|
||||
|
||||
## After Callbacks
|
||||
|
||||
Once the data has been saved to the server, use after callbacks to trigger any other actions you need to happen. An example might be sending a welcome email when someone creates a new object. You can no longer cancel the save, but you can stop further callbacks from executing by calling `next(false);`
|
||||
|
||||
| Name | On | Description |
|
||||
| :--- | :--- | :--- |
|
||||
| after_create | create | Called after creating a new object in a collection. |
|
||||
| after_update | update | Called after updating an existing object in a collection. |
|
||||
| after_save | create or update | Called after saving any object in a collection. |
|
||||
|
||||
## Multiple Callbacks
|
||||
|
||||
You can use several callbacks together, just remember to call `next(object);` to continue the chain.
|
||||
|
||||
## Firing Order
|
||||
|
||||
Callbacks are fired in a specific order. Here is a breakdown of each possible chain.
|
||||
|
||||
**Creating New Object:**
|
||||
|
||||
1. before_create
|
||||
1. before_save
|
||||
1. [saves]
|
||||
1. after_create
|
||||
1. after_save
|
||||
|
||||
**Saving Existing Object:**
|
||||
|
||||
1. before_update
|
||||
1. before_save
|
||||
1. [saves]
|
||||
1. after_update
|
||||
1. after_save
|
9
docs/cms/15_SDK/05_PHP/25_Methods/06_Count.md
Normal file
9
docs/cms/15_SDK/05_PHP/25_Methods/06_Count.md
Normal file
@ -0,0 +1,9 @@
|
||||
Count() will return the number of objects in a collection that match your query.
|
||||
|
||||
To call the API, use the $cms variable and provide the count() method with a collection name:
|
||||
|
||||
$count = $cms->count('listings');
|
||||
|
||||
This can be used in conjuction with filters:
|
||||
|
||||
$count = $cms->filter(array('account' => '25'))->count('listings');
|
13
docs/cms/15_SDK/05_PHP/25_Methods/07_Sort.md
Normal file
13
docs/cms/15_SDK/05_PHP/25_Methods/07_Sort.md
Normal file
@ -0,0 +1,13 @@
|
||||
Sort allows a Multiple() query to return objects from a collection in a desired order.
|
||||
|
||||
The sort() method accepts an array or JSON string of field types and order direction ("asc" or "desc").
|
||||
|
||||
$listings = $cms->sort(array('state' => 'asc', 'name' => 'asc'))->multiple('listings');
|
||||
|
||||
$listings = $cms->sort("{'state':'asc', 'name':'asc'}")->multiple('listings');
|
||||
|
||||
Sort() can also be used in conjuction with filters to finely control query output.
|
||||
|
||||
$listings = $cms->sort(array('state' => 'asc', 'name' => 'asc'))->filter(array('account_id' => '25'))->multiple('listings');
|
||||
|
||||
$listings = $cms->sort("{'state':'asc', 'name':'asc'}")->filter("{'account_id':'25')}")->multiple('listings');
|
9
docs/cms/15_SDK/05_PHP/25_Methods/08_Filter.md
Normal file
9
docs/cms/15_SDK/05_PHP/25_Methods/08_Filter.md
Normal file
@ -0,0 +1,9 @@
|
||||
Filter can be used in conjuction with a Single() or Multiple() query to find specific records in a collection. Applying a filter will allow a query to return records in the collection with matching field values.
|
||||
|
||||
An associative array or JSON string can be passed to the filter:
|
||||
|
||||
$listing = $cms->filter(array('account_id' => '25'))->multiple('listings');
|
||||
|
||||
or
|
||||
|
||||
$listing = $cms->filter("{'account_id':'25'}")->multiple('listings');
|
5
docs/cms/15_SDK/05_PHP/25_Methods/09_Id.md
Normal file
5
docs/cms/15_SDK/05_PHP/25_Methods/09_Id.md
Normal file
@ -0,0 +1,5 @@
|
||||
object **id** ( int *$id* )
|
||||
|
||||
Slug() provides shorthand filtering in conjunction with Single(). It will match the collection object with the specified id parameter.
|
||||
|
||||
$listing = $cms->id(4775)->single('listings');
|
6
docs/cms/15_SDK/05_PHP/25_Methods/10_Slug.md
Normal file
6
docs/cms/15_SDK/05_PHP/25_Methods/10_Slug.md
Normal file
@ -0,0 +1,6 @@
|
||||
object **slug** ( string *$slug* )
|
||||
|
||||
Slug() provides shorthand filtering in conjunction with Single(). It will match the collection object with the specified slug parameter.
|
||||
|
||||
$listing = $cms->slug('listing-5')->single('listings');
|
||||
|
5
docs/cms/15_SDK/05_PHP/25_Methods/11_Param.md
Normal file
5
docs/cms/15_SDK/05_PHP/25_Methods/11_Param.md
Normal file
@ -0,0 +1,5 @@
|
||||
object **param** ( string *$key*, string *$value* )
|
||||
|
||||
Param() privides a means of adding arbitrary parameters to a TodayCMS API call.
|
||||
|
||||
$cms->param('overwrite', true);
|
17
docs/cms/15_SDK/05_PHP/25_Methods/15_Read.md
Normal file
17
docs/cms/15_SDK/05_PHP/25_Methods/15_Read.md
Normal file
@ -0,0 +1,17 @@
|
||||
Read() provides a means for Single() and Multiple() to interface with the TodayCMS API and query the API for objects from a specified collection. query the API for objects from a specified collection.
|
||||
|
||||
$listings = $cms->read('listings');
|
||||
// returns all objects from the 'listings' collection
|
||||
|
||||
It can be used in conjunction with Sort() and Filter() to provide fine control over query results.
|
||||
|
||||
$listings1 = $cms->sort(array('name':'asc'))->multiple('listings');
|
||||
// returns all objects from the 'listings' collection, sorted in ascending order by 'name'
|
||||
|
||||
$listings2 = $cms->filter(array('account_id':'25'))->multiple('listings');
|
||||
// returns all objects from the 'listings' collection with an 'account_id' matching '25'
|
||||
|
||||
It can be used in conjuction with 'limit' and 'offset' parameters to determine the maximum number of results and paging.
|
||||
|
||||
$listings = $cms->param('limit', 15)->param('offset', 2)->multiple('listings');
|
||||
// returns 15 objects from the second page of results, or objects 16-30
|
5
docs/cms/15_SDK/05_PHP/25_Methods/16_Create.md
Normal file
5
docs/cms/15_SDK/05_PHP/25_Methods/16_Create.md
Normal file
@ -0,0 +1,5 @@
|
||||
Create() provides a means of interfacing with the TodayCMS API to create a new object in a specified collection.
|
||||
|
||||
$listing = $cms->create('listings', array('name' => 'Listing Name', 'account_id' => '25'));
|
||||
|
||||
Returns an associative array of the new object or false.
|
17
docs/cms/15_SDK/05_PHP/25_Methods/17_Update.md
Normal file
17
docs/cms/15_SDK/05_PHP/25_Methods/17_Update.md
Normal file
@ -0,0 +1,17 @@
|
||||
Update() provides a means of interfacing with the TodayCMS API to update an object or group of objects in a specified collection.
|
||||
|
||||
Update() must be used in conjunction with Filter(). An empty filter object will allow Update() to modify all objects in the collection; otherwise, all objects matching the filter object parameters will be modified.
|
||||
|
||||
To modify all objects in a collection:
|
||||
|
||||
$listing = $cms->filter()->update('listings', array('name' => 'Listing Name', 'account_id' => '25'));
|
||||
|
||||
To modify a subset of objects in a collection:
|
||||
|
||||
$listing = $cms->filter(array('state' => 'ND'))->update('listings', array('name' => 'Listing Name', 'account_id' => '25'));
|
||||
|
||||
By default, Update() will merge data with the existing data in the object. If you wish to overwrite all data in the object with the newly provided data, you must set the 'overwrite' parameter to 'true'.
|
||||
|
||||
$listing = $cms->param('overwrite', true)->filter()->update('listings', array('name' => 'Listing Name', 'account_id' => '25'));
|
||||
|
||||
Returns an associative array of the new object or false.
|
15
docs/cms/15_SDK/05_PHP/25_Methods/18_Delete.md
Normal file
15
docs/cms/15_SDK/05_PHP/25_Methods/18_Delete.md
Normal file
@ -0,0 +1,15 @@
|
||||
array **delete** ( string *$collection* )
|
||||
|
||||
Delete() provides a means of interfacing with the TodayCMS API to delete an object or group of objects in a specified collection.
|
||||
|
||||
Delete() must be used in conjunction with Filter(). An empty filter object will allow Delete() to remove all objects in the collection; otherwise, all objects matching the filter object parameters will be removed from the datastore.
|
||||
|
||||
To delete all objects in a collection:
|
||||
|
||||
$listing = $cms->filter()->delete('listings');
|
||||
|
||||
To delete a subset of objects in a collection:
|
||||
|
||||
$listing = $cms->filter(array('state' => 'ND'))->delete('listings');
|
||||
|
||||
Returns an associative array of the new object or false.
|
9
docs/cms/15_SDK/05_PHP/25_Methods/19_GetApiUrl.md
Normal file
9
docs/cms/15_SDK/05_PHP/25_Methods/19_GetApiUrl.md
Normal file
@ -0,0 +1,9 @@
|
||||
string **get_api_url** ( string *$collection* )
|
||||
|
||||
Get_Api_Url() is a helper method for accessing the current construction of the TodayCMS API call url. It returns the full path to the API along with the api key and all parameters that have been attached with Param(), Sort(), Filter(), Slug(), and Id().
|
||||
|
||||
$listing = $cms->param('overwrite', true)->id(25));
|
||||
|
||||
$url = $cms->get_api_url('listings');
|
||||
// 'http://path.to.api/collections/listings/25?_tokens&overwrite=true'
|
||||
|
38
docs/cms/16_Front-End_Helpers/05_PHP/01_Map/01_Methods.md
Normal file
38
docs/cms/16_Front-End_Helpers/05_PHP/01_Map/01_Methods.md
Normal file
@ -0,0 +1,38 @@
|
||||
object **latlng** ( int *$lat*, int *$lng* )
|
||||
|
||||
Sets the latitude and longitude of the Map object.
|
||||
|
||||
$map->latlng(40.11, -100.20);
|
||||
|
||||
object **height** ( string *$height* )
|
||||
|
||||
Sets the max-height of the Map object in 'px' or '%'.
|
||||
|
||||
$map1->height('400px');
|
||||
$map2->height('100%');
|
||||
|
||||
object **width** ( string *$width* )
|
||||
|
||||
Sets the max-width of the Map object in 'px' or '%'.
|
||||
|
||||
$map1->width('400px');
|
||||
$map2->width('100%');
|
||||
|
||||
object **infoWindow** ( string *$content* )
|
||||
|
||||
Sets the content of the infoWindow displayed in the embeddable Map object.
|
||||
|
||||
$map->infoWindow('Hello World!');
|
||||
|
||||
object **infoWindowMaxWidth** ( string *$maxwidth* )
|
||||
|
||||
Sets the max-width of the Map object in 'px' or '%'.
|
||||
|
||||
$map1->width('400px');
|
||||
$map2->width('100%');
|
||||
|
||||
string **render** ( *void* )
|
||||
|
||||
$map->render();
|
||||
|
||||
Renders Map object into an embeddable string that displays a Google Map on the webpage.
|
10
docs/cms/16_Front-End_Helpers/05_PHP/01_Map/02_Usage.md
Normal file
10
docs/cms/16_Front-End_Helpers/05_PHP/01_Map/02_Usage.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
The Map object can be initialized with a latitude and longitude:
|
||||
|
||||
$map1 = new Map(40.11, -100.20);
|
||||
$map1->render();
|
||||
|
||||
Alternatively, you can add properties to the Map with various setter Methods.
|
||||
|
||||
$map2 = new Map();
|
||||
$map2->latlng(40.11, -100.20)->width('640px')->height('480px')->infoWindow('Hello World!')->render();
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"title": "TodayCMS Documentation",
|
||||
"homepage": "/Getting_Started",
|
||||
"theme": "bootstrap",
|
||||
"hightlight": "none",
|
||||
"theme": "simplex",
|
||||
"hightlight": "dark",
|
||||
"twitter": ["todaymade"],
|
||||
"links": {
|
||||
"Todaymade": "http://todaymade.com",
|
@ -3,11 +3,12 @@
|
||||
"tagline": "The Easiest Way To Document Your App",
|
||||
"image": "/img/app.png",
|
||||
"theme": "navy",
|
||||
"repo": "justinwalsh/tm-docs",
|
||||
"float": false,
|
||||
"repo": "justinwalsh/daux.io",
|
||||
"twitter": ["justin_walsh", "todaymade"],
|
||||
"links": {
|
||||
"Github Repo": "https://github.com/justinwalsh/tm-docs",
|
||||
"Help/Support/Bugs": "https://github.com/justinwalsh/tm-docs/issues",
|
||||
"Github Repo": "https://github.com/justinwalsh/daux.io",
|
||||
"Help/Support/Bugs": "https://github.com/justinwalsh/daux.io/issues",
|
||||
"Todaymade": "http://todaymade.com"
|
||||
}
|
||||
}
|
38
index.php
38
index.php
@ -26,14 +26,14 @@ Feedback & Suggestions
|
||||
To give us feedback or to suggest an idea, please create an request on the the
|
||||
Github issue tracker:
|
||||
|
||||
https://github.com/justinwalsh/tm-docs/issues
|
||||
https://github.com/justinwalsh/daux.io/issues
|
||||
|
||||
Bugs
|
||||
----
|
||||
|
||||
To file bug reports please create an issue using the github issue tracker:
|
||||
|
||||
https://github.com/justinwalsh/tm-docs/issues
|
||||
https://github.com/justinwalsh/daux.io/issues
|
||||
|
||||
|
||||
Copyright and License
|
||||
@ -63,12 +63,18 @@ software, even if advised of the possibility of such damage.
|
||||
|
||||
*/
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
require_once('libs/functions.php');
|
||||
require_once('libs/functions.php');
|
||||
|
||||
$options = get_options();
|
||||
$tree = get_tree("docs");
|
||||
$homepage_url = homepage_url($tree);
|
||||
$docs_url = docs_url($tree);
|
||||
|
||||
// Redirect to docs, if there is no homepage
|
||||
if ($homepage && $homepage_url !== '/') {
|
||||
header('Location: '.$homepage_url);
|
||||
}
|
||||
|
||||
$options = get_options();
|
||||
$tree = get_tree("docs");
|
||||
?>
|
||||
<!doctype html>
|
||||
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
|
||||
@ -78,8 +84,8 @@ software, even if advised of the possibility of such damage.
|
||||
<html>
|
||||
<head>
|
||||
<title><?=$options['title']; ?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="description" content="<?=$options['tagline'];?>" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="description" content="<?=$options['tagline'];?>" />
|
||||
<meta name="author" content="<?=$options['title']; ?>">
|
||||
<? if ($options['colors']) { ?>
|
||||
<link rel="icon" href="/img/favicon.png" type="image/x-icon">
|
||||
@ -123,7 +129,7 @@ software, even if advised of the possibility of such damage.
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand pull-left" href="/"><?=$options['title']; ?></a>
|
||||
<a class="brand pull-left" href="<?=$homepage_url;?>"><?=$options['title']; ?></a>
|
||||
<p class="navbar-text pull-right">
|
||||
Generated by <a href="http://daux.io">Daux.io</a>
|
||||
</p>
|
||||
@ -154,10 +160,12 @@ software, even if advised of the possibility of such damage.
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="text-center span12">
|
||||
<a href="#" class="btn btn-secondary btn-hero">
|
||||
View On GitHub
|
||||
</a>
|
||||
<a href="#" class="btn btn-primary btn-hero">
|
||||
<? if ($options['repo']) { ?>
|
||||
<a href="https://github.com/<?=$options['repo']; ?>" class="btn btn-secondary btn-hero">
|
||||
View On GitHub
|
||||
</a>
|
||||
<? } ?>
|
||||
<a href="<?=$docs_url;?>" class="btn btn-primary btn-hero">
|
||||
View Documentation
|
||||
</a>
|
||||
</div>
|
||||
@ -210,7 +218,7 @@ software, even if advised of the possibility of such damage.
|
||||
<div class="container-fluid fluid-height wrapper">
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<a class="brand pull-left" href="/"><?=$options['title']; ?></a>
|
||||
<a class="brand pull-left" href="<?=$homepage_url;?>"><?=$options['title']; ?></a>
|
||||
<p class="navbar-text pull-right">
|
||||
Generated by <a href="http://daux.io">Daux.io</a>
|
||||
</p>
|
||||
|
@ -1,4 +1,6 @@
|
||||
<?
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
/*
|
||||
* WARNING: DO NOT EDIT THIS FILE.
|
||||
@ -6,6 +8,8 @@
|
||||
* Daux.io without overwritting your changes. Instead use the config.json file
|
||||
* in the /docs folder to customize your documentation.
|
||||
*
|
||||
* Want to add a new feature? Send me a pull request or open an issue - https://github.com/justinwalsh/daux.io
|
||||
*
|
||||
* Learn more about what you can customize here: http://daux.io
|
||||
*/
|
||||
|
||||
@ -19,13 +23,12 @@ if ($path === '/' || $path === '') {
|
||||
$homepage = false;
|
||||
}
|
||||
|
||||
// TM-Docs Functions
|
||||
// Daux.io Functions
|
||||
function get_options() {
|
||||
$options = array(
|
||||
'title' => "Documentation",
|
||||
'tagline' => false,
|
||||
'image' => false,
|
||||
'homepage' => false,
|
||||
'theme' => 'blue',
|
||||
'float' => true,
|
||||
'repo' => false,
|
||||
@ -54,16 +57,38 @@ function get_options() {
|
||||
}
|
||||
}
|
||||
|
||||
// Homepage Redirect?
|
||||
$path = url_path();
|
||||
if ($path === '/') {
|
||||
// Custom Homepage?
|
||||
if ($options['homepage']) {
|
||||
header('Location: '.$options['homepage']);
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
|
||||
function homepage_url($tree) {
|
||||
// Check for homepage
|
||||
if (isset($tree['index'])) {
|
||||
return '/';
|
||||
} else {
|
||||
return docs_url($tree);
|
||||
}
|
||||
}
|
||||
|
||||
function docs_url($tree, $branch = false) {
|
||||
// Get next branch
|
||||
if (!$branch) {
|
||||
$branch = current($tree);
|
||||
}
|
||||
|
||||
return $options;
|
||||
if ($branch['type'] === 'file') {
|
||||
return $branch['url'];
|
||||
} else if (!empty($branch['tree'])) {
|
||||
return docs_url($branch['tree']);
|
||||
} else {
|
||||
// Try next folder...
|
||||
$branch = next($tree);
|
||||
if ($branch) {
|
||||
return docs_url($tree, $branch);
|
||||
} else {
|
||||
echo '<strong>Daux.io Config Error:</strong><br>Unable to find the first page in the /docs folder. Double check you have at least one file in the root of of the /docs folder. Also make sure you do not have any empty folders. Visit the docs to <a href="http://daux.io">learn more</a> about how the default routing works.';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function load_page($tree) {
|
||||
@ -135,6 +160,9 @@ function clean_name($text) {
|
||||
}
|
||||
|
||||
function build_nav($tree, $url_params = false) {
|
||||
// Remove Index
|
||||
unset($tree['index']);
|
||||
|
||||
if (!is_array($url_params)) {
|
||||
$url_params = url_params();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "tm-docs",
|
||||
"name": "daux.io",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
|
@ -1,5 +0,0 @@
|
||||
All calls to the api must include a _token parameter to validate the call.
|
||||
|
||||
http://todaycms-api.herokuapp.com/?_token=XXXXXXXXXXXX
|
||||
|
||||
This guide will not include the _token in the sample calls. It is implied that it must be included.
|
@ -1,12 +0,0 @@
|
||||
To read from a collection, issue a HTTP GET call
|
||||
|
||||
GET /collections/:collection
|
||||
|
||||
|
||||
**URL Parameters**
|
||||
|
||||
`:collection` is the key of the collection in the config.
|
||||
|
||||
**Returns**
|
||||
|
||||
An array of objects from the collection.
|
@ -1,18 +0,0 @@
|
||||
To update an object in a collection, issue a HTTP POST call with the object in the body of the POST.
|
||||
|
||||
POST /collections/:collection/:id
|
||||
|
||||
name = Justin Walsh
|
||||
employment = part
|
||||
bio = Documention writer
|
||||
...
|
||||
|
||||
**URL Parameters**
|
||||
|
||||
`:collection` is the key of the collection in the config.
|
||||
|
||||
`:id` is the id of the object you want to update.
|
||||
|
||||
**Returns**
|
||||
|
||||
The object you just updated.
|
@ -1 +0,0 @@
|
||||
Coming Soon
|
@ -1,152 +0,0 @@
|
||||
To filter an api call, send the optional `filter` parameter. The filter parameter is a structured json object. Examples use the following terms:
|
||||
|
||||
* field key - Is the key used to define the field in the config.
|
||||
* operator - Is the comparison to preform.
|
||||
* value - Is what we will compare the object value to.
|
||||
|
||||
## Basic Structure
|
||||
|
||||
This is the most basic filter that can be preformed.
|
||||
|
||||
{
|
||||
"field key": "value"
|
||||
}
|
||||
|
||||
*Example Call:*
|
||||
|
||||
GET /collections/team?filter={"employment":"full"}
|
||||
|
||||
This will find all full time team members in the collection.
|
||||
|
||||
## Advanced Structure
|
||||
|
||||
This structure allows more advanced control over operators used when filtering.
|
||||
|
||||
{
|
||||
"field key": {
|
||||
"operator": "value"
|
||||
}
|
||||
}
|
||||
|
||||
*Example Call:*
|
||||
|
||||
GET /collections/team?filter={"employment": {"!=": "retired"}}
|
||||
|
||||
This will find all team members who are not retired in the collection.
|
||||
|
||||
## Multiple Operators Structure
|
||||
|
||||
You can preform multiple comparision operations on the same field
|
||||
|
||||
{
|
||||
"field key": {
|
||||
"operator": "value",
|
||||
"operator2": "value2",
|
||||
"operatorx..": "valuex.."
|
||||
}
|
||||
}
|
||||
|
||||
*Example Call:*
|
||||
|
||||
GET /collections/team?filter={"name": {"LIKE":"Justin%", "!=":"Justin Walsh"}}
|
||||
|
||||
This will find all team members who's names start with 'Justin' but are not 'Justin Walsh'.
|
||||
|
||||
## Multiple Fields Structure
|
||||
|
||||
You can filter multiple fields by adding each field key to the object.
|
||||
|
||||
{
|
||||
"field key 1": "value",
|
||||
"field key 2": {
|
||||
"operator": "value"
|
||||
},
|
||||
"field key 3": {
|
||||
"operator": "value"
|
||||
}
|
||||
}
|
||||
|
||||
## Multiple Values Structure
|
||||
|
||||
When filtering, you can use an array instead of a string to match any of the values in the array.
|
||||
|
||||
{
|
||||
"employment": ["full", "part"],
|
||||
"name": {
|
||||
"LIKE": ["Justin%", "Brian%"]
|
||||
}
|
||||
}
|
||||
|
||||
This will match all team members who are full or part time, and whose names starts with 'Justin' or 'Brian'.
|
||||
|
||||
Note: `"employment": ["full", "part"]` is equvalient to
|
||||
|
||||
"employment": {
|
||||
"=": ["full", "part"]
|
||||
}
|
||||
|
||||
## Nested Fields Structure
|
||||
|
||||
You can filter by nested fields in the object using a dot notation syntax as the field key in the filter. This syntax can be used to query deep into nested objects and arrays, including fields like the 'multi'.
|
||||
|
||||
{
|
||||
"address.zip": "58501"
|
||||
}
|
||||
|
||||
This will filter the location field type by zip code, which is a nested field. This example is based on the sample config at the top of this guide.
|
||||
|
||||
## AND/OR Fields Structure (Not Supported Yet)
|
||||
|
||||
This structure allows a very customized query including both `-and` and `-or` statments.
|
||||
|
||||
{
|
||||
"field key 3": {
|
||||
"operator": "value"
|
||||
},
|
||||
"-or": {
|
||||
"field key 1": "value",
|
||||
"-and": {
|
||||
"field key 2": {
|
||||
"operator": "value"
|
||||
},
|
||||
"field key 4": {
|
||||
"operator": "value"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
## Supported Operators
|
||||
|
||||
| Operator | Description |
|
||||
| :--- | :--- |
|
||||
| = | equal to |
|
||||
| != | not equal to |
|
||||
| > | greater than |
|
||||
| < | less than |
|
||||
| >= | greater than or equal to |
|
||||
| <= | less than or equal to |
|
||||
| LIKE | case sensitive search, use '%' for wildcard |
|
||||
| ILIKE | case insensitive search, use '%' for wildcard |
|
||||
| NOT LIKE | inverse of 'LIKE' |
|
||||
| NOT ILIKE | inverse of 'ILIKE' |
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
**JSON Filtering**
|
||||
|
||||
The JSON object used for the `filter` parameter must be url encoded when calling the api. Here are examples of how to url encode a json object or string in different languages.
|
||||
|
||||
***php***
|
||||
|
||||
$escaped_json = urlencode('{"name": {"LIKE":"Justin%", "!=":"Justin Walsh"}}');
|
||||
|
||||
***javascript string***
|
||||
|
||||
var escaped_json_from_string = escape('{"name": {"LIKE":"Justin%", "!=":"Justin Walsh"}}');
|
||||
|
||||
***javascript object***
|
||||
|
||||
var escaped_json_from_object = escape(JSON.stringify({"name": {"LIKE":"Justin%", "!=":"Justin Walsh"}}));
|
@ -1,41 +0,0 @@
|
||||
A config object that contains other objects (admin sections) and displays them in a group.
|
||||
|
||||
Parent elements are characterized by a subhead in the admin panel navigation. They also group elements in the [[Outline (call)]].
|
||||
|
||||
{
|
||||
"sample_parent": {
|
||||
"title": "Sample Parent",
|
||||
"type": "parent"
|
||||
}
|
||||
}
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Default | Description |
|
||||
| :------------- | :------------- | :------------- |
|
||||
| title | required | Descriptive title of the object. This value will be used to identify the object in the admin panel sidebar navigation. Required field. |
|
||||
| type | parent | Object identifier. Required, must be set to: 'parent' |
|
||||
|
||||
### Single
|
||||
The Single object is created in the config.json file. This will create a single page that can be edited in the admin panel and displayed on the front end.
|
||||
|
||||
{
|
||||
"single-name": {
|
||||
"title": "single-title",
|
||||
"parent": "sample_parent",
|
||||
"type": "single",
|
||||
"fields": {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Default | Description |
|
||||
| :------------- | :------------- | :------------- |
|
||||
| title | required | Descriptive title of the page. This value will be used to identify the object in the admin panel sidebar navigation. Required field. |
|
||||
| type | single | Object identifier. Required, must be set to: 'single.' |
|
||||
| parent | - | Defines parent container object. Allows you to group multiple objects together in the admin panel (like a folder). |
|
||||
| nav | true | Allows you to hide or show object elements in the admin panel. |
|
||||
|
@ -1,20 +0,0 @@
|
||||
The Single object is created in the config.json file. This will create a single page that can be edited in the admin panel and displayed on the front end.
|
||||
|
||||
{
|
||||
"single-name": {
|
||||
"title": "single-title",
|
||||
"parent": "sample_parent",
|
||||
"type": "single",
|
||||
"fields": {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
### Parameters
|
||||
| Name | Default | Description |
|
||||
| :------------- | :------------- | :------------- |
|
||||
| title | required | Descriptive title of the page. This value will be used to identify the object in the admin panel sidebar navigation. Required field. |
|
||||
| type | single | Object identifier. Required, must be set to: 'single.' |
|
||||
| parent | - | Defines parent container object. Allows you to group multiple objects together in the admin panel (like a folder). |
|
||||
| nav | true | Allows you to hide or show object elements in the admin panel. |
|
@ -1,45 +0,0 @@
|
||||
The Multiple object is created in the 'config.json' file. This will create a group of many pages (records) that can be edited in the admin panel and displayed on the front end.
|
||||
|
||||
{
|
||||
"multiple-name": {
|
||||
"title": "multiple-title",
|
||||
"parent": "sample_parent",
|
||||
"type": "multiple",
|
||||
"fields": {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Default | Options | Description |
|
||||
| :------------- | :------------- | :------------- | :------------- |
|
||||
| title | required | | Descriptive title of the object. This value will be used to identify the object in the admin panel sidebar navigation. Required field. |
|
||||
| type | multiple | | Object identifier. Required, must be set to: 'multiple.' |
|
||||
| parent | '' | | Defines parent container object. Allows you to group multiple objects together in the admin panel (like a folder). |
|
||||
| nav | true | true,false | Allows you to hide or show object elements in the admin panel. |
|
||||
| filters | '' | | Creates a select menu in the admin panel that will filter returned records. |
|
||||
| sort | '' | asc, desc | Sorts records on call. |
|
||||
| display | '' | | Defines values to display in the admin output table for each record. |
|
||||
| download | true | true,false | Enables raw data download from admin panel. (csv file) |
|
||||
| redirects | true | true,false | Enables option to create link (url) based records. |
|
||||
| publish | true | true,false | Removes ability to save individual record as draft. |
|
||||
|
||||
## Filters Example
|
||||
|
||||
{
|
||||
"filters": ["value"]
|
||||
}
|
||||
|
||||
## Sort Example
|
||||
{
|
||||
"sort":{
|
||||
"value":"asc"
|
||||
}
|
||||
}
|
||||
|
||||
## Display Example
|
||||
{
|
||||
"display":["fname", "lname", "phone", "email"]
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
Creates a color picker field that will return a hex value through the API.
|
||||
|
||||
![TodayCMScolor picker](http://space.todaymade.com/todaycms/colorpicker2.jpg)
|
||||
|
||||
"color": {
|
||||
"title": "Color Picker",
|
||||
"type": "colorpicker"
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
Creates a single date field with a visual calendar drop down.
|
||||
|
||||
![Todaycms date field](http://space.todaymade.com/todaycms/date.jpg)
|
||||
|
||||
"date": {
|
||||
"title": "Date Field",
|
||||
"type": "date"
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
Creates a single date and time field with a visual drop down for each.
|
||||
|
||||
![todaycms date and time field](http://space.todaymade.com/todaycms/datetime.jpg)
|
||||
|
||||
"datetime": {
|
||||
"title": "Date Time Field",
|
||||
"type": "datetime"
|
||||
}
|
||||
|
||||
Returns a single date/time value.
|
||||
|
||||
[datetime] => 01/16/2012 12:00 am
|
@ -1,9 +0,0 @@
|
||||
Creates a page divider with customizable text. Visible only from the CMS.
|
||||
|
||||
![todaycms divider field](http://space.todaymade.com/todaycms/divider.jpg)
|
||||
|
||||
"divider-1": {
|
||||
"title": "Page Divider",
|
||||
"type": "divider"
|
||||
}
|
||||
|
@ -1,18 +0,0 @@
|
||||
Creates a single file upload field.
|
||||
|
||||
![TodayCMS File](http://space.todaymade.com/todaycms/file.jpg)
|
||||
|
||||
"file": {
|
||||
"title": "File Field",
|
||||
"type": "file"
|
||||
}
|
||||
|
||||
Returns an array.
|
||||
|
||||
[file] => Array
|
||||
(
|
||||
[caption] =>
|
||||
[date] => 11/1/2012
|
||||
[url] => http://todaycms.s3.amazonaws.com/...filename.pdf
|
||||
[name] => filename.pdf
|
||||
)
|
@ -1,21 +0,0 @@
|
||||
Creates multiple file upload fields with sort and caption options.
|
||||
|
||||
![todaycms files](http://space.todaymade.com/todaycms/files.jpg)
|
||||
|
||||
"files": {
|
||||
"title": "Files Field",
|
||||
"type": "files"
|
||||
}
|
||||
|
||||
Returns a multidimensional array.
|
||||
|
||||
[files] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[caption] => Pre-Order Form
|
||||
[date] => 2/13/2012
|
||||
[url] => http://todaycms.s3.amazonaws.com/...filename.pdf
|
||||
[name] => Author Visit - Beth McKinney.pdf
|
||||
)
|
||||
)
|
@ -1,28 +0,0 @@
|
||||
Creates an instance of the TodayCMS FormBuilder. This will allow end users to create complex forms with a variety of options for data collection and submission.
|
||||
|
||||
![TodayCMS Formbuilder](http://space.todaymade.com/todaycms/formbuilder.jpg)
|
||||
|
||||
"form": {
|
||||
"title": "Form Builder",
|
||||
"type": "formbuilder"
|
||||
}
|
||||
|
||||
**Available Fields**
|
||||
|
||||
* Single Line Text
|
||||
* Multiple Line Text
|
||||
* Dropdown Select
|
||||
* Checkbox Options
|
||||
* Multiple Choice (Radio Buttons)
|
||||
* Phone
|
||||
* Email
|
||||
|
||||
**Form Actions**
|
||||
|
||||
* Redirect to another page
|
||||
* Display a message
|
||||
* Send to Paypal
|
||||
|
||||
**Returns**
|
||||
|
||||
See the [[Formbuilder (helper)]]
|
@ -1,40 +0,0 @@
|
||||
Creates a hidden form field.
|
||||
|
||||
"hidden": {
|
||||
"title": "Hidden Field",
|
||||
"type": "hidden",
|
||||
}
|
||||
|
||||
"hidden-forced-value": {
|
||||
"title": "Hidden Forced Value Field",
|
||||
"type": "hidden",
|
||||
"value": "Forced Value"
|
||||
}
|
||||
|
||||
"hidden-default-value": {
|
||||
"title": "Hidden Default Value Field",
|
||||
"type": "hidden",
|
||||
"default": "Default Value"
|
||||
}
|
||||
|
||||
"hidden-timestamp-value": {
|
||||
"title": "Hidden Timestamp Value Field",
|
||||
"type": "hidden",
|
||||
"default": "timestamp"
|
||||
}
|
||||
|
||||
"hidden-display-value": {
|
||||
"title": "Hidden Display Field",
|
||||
"type": "hidden",
|
||||
"value": "You should see this",
|
||||
"display": true
|
||||
}
|
||||
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Default | Options | Description |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| default | '' | string, timestamp | Sets a default value for the hidden field. Timestamp will display current date/time. |
|
||||
| display | false | true,false | Can see the value but can't change it |
|
||||
| auto_increment | false | true, false | Creates unique id starting with 1. |
|
@ -1,53 +0,0 @@
|
||||
Creates a single image upload field.
|
||||
|
||||
![image](http://space.todaymade.com/todaycms/image-field.jpg)
|
||||
|
||||
"image": {
|
||||
"title": "Image Field",
|
||||
"type": "image",
|
||||
"sizes": {
|
||||
"thumb": {
|
||||
"height": 150,
|
||||
"width": 150,
|
||||
"resize_strategy": "crop"
|
||||
},
|
||||
"large": {
|
||||
"height": 500,
|
||||
"width": 500,
|
||||
"resize_strategy": "fit"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Image fields allows you to determine multiple thumbnail/image sizes and cropping techniques.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| width | 1-5000 | Width of the input image | Width of the new image, in pixels |
|
||||
| height | 1-5000 | Height of the input image | Height of the new image, in pixels |
|
||||
| strip | boolean | false | Strips all metadata from the image. This is useful to keep thumbnails as small as possible. |
|
||||
| flatten | boolean | true | Flattens all layers onto the specified background to achive better results from transparent formats to non-transparent formats, as explained in the [ImageMagick](http://www.imagemagick.org/script/command-line-options.php?#layers) documentation. **Important:** To preserve animations, GIF files are not flattened when this is set to true. To flatten GIF animations, use the frame parameter. |
|
||||
| correct_gamma | boolean | false | Prevents gamma errors [common in many image scaling algorithms](http://www.4p8.com/eric.brasseur/gamma.html). |
|
||||
| quality | 1-100 | Quality of the input image, or 92 | Controls the image compression for JPG and PNG images. |
|
||||
| background | string | "#FFFFFF" | Either the hexadecimal code or [name](http://www.imagemagick.org/script/color.php#color_names) of the color used to fill the background (only used for the pad resize strategy). **Important:** By default, the background of transparent images is changed to white. For details about how to preserve transparency across all image types, see [this demo](https://transloadit.com/demos/image-resize/properly-preserve-transparency-across-all-image-types). |
|
||||
| resize_strategy | string | "fit" | See [[Resize Strategies Table]] |
|
||||
| zoom | boolean | true | If this is set to false, smaller images will not be stretched to the desired width and height. For details about the impact of zooming for your preferred resize strategy, see the [[Resize Strategies Table]]. |
|
||||
| crop | { x1: integer, y1: integer, x2: integer, y2: integer } | {} | Specify an object containing coordinates for the top left and bottom right corners of the rectangle to be cropped from the original image(s). For example, `{x1: 80, y1: 100, x2: 160, y2: 180}` will crop the area from `(80,100)` to `(160,180)` which is a square whose width and height are 80px. If crop is set, the width and height parameters are ignored, and the resize_strategy is set to crop automatically. |
|
||||
| format | string | Format of the input image | The available formats are `"jpg"`, `"png"`, `"gif"`, and `"tiff"`. |
|
||||
| gravity | string | center | The direction from which the image is to be cropped. The available options are `"center"`, `"top"`, `"bottom"`, `"left"`, and `"right"`. You can also combine options with a hyphen, such as `"bottom-right"`. |
|
||||
| frame | integer | null (all frames) | Use this parameter when dealing with animated GIF files to specify which frame of the GIF is used for the operation. Specify 1 to use the first frame, 2 to use the second, and so on. |
|
||||
| colorspace | string | " " | Sets the image colorspace. For details about the available values, see the [ImageMagick documentation](http://www.imagemagick.org/script/command-line-options.php#colorspace). |
|
||||
| rotation | string / boolean / integer | true | Determines whether the image should be rotated. Set this to true to auto-rotate images that are misrotated, or depend on EXIF rotation settings. You can also set this to an integer to specify the rotation in degrees. You can also specify degrees> to rotate only when the image width exceeds the height (or degrees< if the width must be less than the height). Specify false to disable auto-fixing of misrotated images. |
|
||||
| compress | string | null | Specifies pixel compression for when the image is written. Valid values are None, `"BZip"`, `"Fax"`, `"Group4"`, `"JPEG"`, `"JPEG2000"`, `"Lossless"`, `"LZW"`, `"RLE"`, and `"Zip"`. Compression is disabled by default. |
|
||||
| blur | string | null | Specifies gaussian blur, using a value with the form `{radius}x{sigma}`. The radius value specifies the size of area the operator should look at when spreading pixels, and should typically be either `"0"` or at least two times the sigma value. The sigma value is an approximation of how many pixels the image is "spread"; think of it as the size of the brush used to blur the image. This number is a floating point value, enabling small values like `"0.5"` to be used. For details about how the radius and sigma values affect blurring, see [this example](http://www.imagemagick.org/Usage/blur/blur_montage.jpg). |
|
||||
|
||||
**Watermark Parameters**
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| watermark_url | string | " " | A url indicating a PNG image to be overlaid above this image. |
|
||||
| watermark_position | string/array | "center" | The position at which the watermark is placed. The available options are `"center"`, `"top"`, `"bottom"`, `"left"`, and `"right"`. You can also combine options, such as `"bottom-right"`. An array of possible values can also be specified, in which case one value will be selected at random, such as `["center","left","bottom-left","bottom-right"]`. _Note that this setting puts the watermark in the specified corner. To use a specific pixel offset for the watermark, you will need to add the padding to the image itself._ |
|
||||
| watermark_size | string | "" | The size of the watermark, as a percentage. For example, a value of `"50%"` means that size of the watermark will be 50% of the size of image on which it is placed. |
|
||||
| watermark_resize_strategy | string | "fit" | Available values are `"fit"` and `"stretch"`. |
|
@ -1,24 +0,0 @@
|
||||
Creates a multi image upload field. Useful for a gallery or rotating image.
|
||||
|
||||
![images](http://space.todaymade.com/todaycms/images.jpeg)
|
||||
|
||||
"images": {
|
||||
"title": "Images Field",
|
||||
"type": "images",
|
||||
"sizes": {
|
||||
"thumb": {
|
||||
"height": 150,
|
||||
"width": 150,
|
||||
"resize_strategy": "crop"
|
||||
},
|
||||
"large": {
|
||||
"height": 500,
|
||||
"width": 500,
|
||||
"resize_strategy": "crop"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
See [parameters table](https://github.com/justinwalsh/todaycms/wiki/Image).
|
||||
|
||||
See [resize strategies table](https://github.com/justinwalsh/todaycms/wiki/Resize-Strategies-Table).
|
@ -1,8 +0,0 @@
|
||||
Creates an instance of the markItUp! universal markup editor. Editor allows easy access to HTML editing.
|
||||
|
||||
![MarkItUp! editor](http://space.todaymade.com/todaycms/markitup.jpeg)
|
||||
|
||||
"markitup": {
|
||||
"title":"Markitup",
|
||||
"type":"markitup"
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
Creates a repeatable object that can utilize all TodayCMS field types.
|
||||
|
||||
![Multi Field](http://space.todaymade.com/todaycms/multi.jpeg)
|
||||
|
||||
"multi": {
|
||||
"title": "Multi Field",
|
||||
"display": "title",
|
||||
"type": "multi",
|
||||
"fields": {
|
||||
...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Default | Options | Description |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| display | '' | | Field name to use as the identifier in the title cell. |
|
@ -1,45 +0,0 @@
|
||||
Creates a form field type that allows the selection of one or more items from a dropdown list.
|
||||
|
||||
![multi select static](http://space.todaymade.com/todaycms/multi-select-static.jpg)
|
||||
|
||||
### Static Options
|
||||
Displays a static list of options.
|
||||
|
||||
"multiselect": {
|
||||
"title": "Multi Select - Static",
|
||||
"type": "multiselect",
|
||||
"options": {
|
||||
"value": "Display Name",
|
||||
"value2": "Display Name 2"
|
||||
}
|
||||
}
|
||||
|
||||
### Reference Options
|
||||
Displays the records from another object in the config. This is commonly used to create multiple relational data associations.
|
||||
|
||||
"referenced-object": {
|
||||
"title": "Referenced Object",
|
||||
"type": "multiple",
|
||||
"fields": {
|
||||
"name": {
|
||||
"title": "Record Name",
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"multiselect": {
|
||||
"title": "Multi Select - Reference",
|
||||
"type": "multiselect",
|
||||
"options": "referenced-object",
|
||||
"display": "name"
|
||||
}
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Default | Options | Description |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| options | '' | | A list of values (object), or reference name for another object in the config. |
|
||||
| display | '' | | Field name to use as the identifier in the dropdown select |
|
||||
|
||||
See also [[Select]].
|
@ -1,8 +0,0 @@
|
||||
Creates a password form field.
|
||||
|
||||
![password](http://space.todaymade.com/todaycms/password.jpg)
|
||||
|
||||
"password": {
|
||||
"title": "Password Field",
|
||||
"type": "password"
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
Creates a form field type that allows the selection of a single item from a dropdown list.
|
||||
|
||||
![static field](http://space.todaymade.com/todaycms/select.jpg)
|
||||
|
||||
### Static Options
|
||||
Displays a static list of options.
|
||||
|
||||
"select": {
|
||||
"title": "Select Field - Static Options",
|
||||
"type": "select",
|
||||
"options": {
|
||||
"value1": "Display Name One",
|
||||
"value2": "Display Name Two",
|
||||
"value3": "Display Name Three"
|
||||
}
|
||||
}
|
||||
|
||||
### Reference Options
|
||||
Displays a list of the records from another object in the config. This is commonly used to create relational data association. For example, a list of categories or a grouping.
|
||||
|
||||
"referenced-object": {
|
||||
"title": "Referenced Object",
|
||||
"type": "multiple",
|
||||
"fields": {
|
||||
"name": {
|
||||
"title": "Record Name",
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"select-reference": {
|
||||
"title": "Select Field - Reference",
|
||||
"type": "select",
|
||||
"options": "referenced-object",
|
||||
"display": "name"
|
||||
}
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Default | Options | Description |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| options | '' | | A list of values (object), or reference name for another object in the config. |
|
||||
| display | '' | | Field name to use as the identifier in the dropdown select |
|
||||
| blank | '' | string | String uses for the default dropdown select option. Value is set to null. |
|
||||
| hidden | false | true, false | Hides the select menu and passes a value through as a hidden field. |
|
||||
| value | | | Sets a default value. |
|
||||
|
||||
See also [[Multiselect]].
|
@ -1,8 +0,0 @@
|
||||
Creates a text form field.
|
||||
|
||||
![text ](http://space.todaymade.com/todaycms/text.jpg)
|
||||
|
||||
"text": {
|
||||
"title": "Text Field",
|
||||
"type": "text"
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
Creates a textarea form field.
|
||||
|
||||
![Textarea](http://space.todaymade.com/todaycms/textarea.jpg)
|
||||
|
||||
"textarea": {
|
||||
"title": "Wysiwyg Field",
|
||||
"type": "textarea"
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
Creates a WYSIWYG textarea form field.
|
||||
|
||||
![WYSIWYG](http://space.todaymade.com/todaycms/wysiwyg.jpg)
|
||||
|
||||
"wysiwyg": {
|
||||
"title": "Wysiwyg Field",
|
||||
"type": "wysiwyg"
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
To create an editor on a page use the following code
|
||||
|
||||
<div id="cms-editor"></div>
|
||||
<script type="text/javascript" src="dist/js/todaycms.js"></script>
|
||||
<script type='text/javascript'>
|
||||
cms_setup({
|
||||
apikey: '7DdPrtGp9ZhKmk',
|
||||
collection: "listings"
|
||||
});
|
||||
</script>
|
||||
|
||||
***Required***: 'apikey' and 'collection' are required parameters for the editor to load.
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user