Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Added Available Conditions page.

  • Loading branch information...
commit bf88a2f4699adbc16172c3f1bb7a2593d82a58ed 1 parent 48d8b22
@yukiawano authored
View
63 docs/en/conditions.md
@@ -0,0 +1,63 @@
+## Available Conditions
+
+Currently these conditions are available.
+However, please remember that they are also still under development and the specifications of them would be changed in the future.
+
+* Location
+* Device
+* NewComer
+
+## Location (code/condition/Location.php)
+
+Location is a condition that where a visitor is accessing from.
+For example, if you are running shops in multiple cities(Otsu, Kyoto), by using this condition, you can show the location of a shop at Otsu for visitors from Otsu city,
+
+Location can be used as the below examples.
+
+e.g.
+```
+Location: Japan
+```
+```
+Location: Otsu
+```
+
+By default, we get location of a visitor from IPInfoDB.
+You can specify the location with the name which is used in IPInfoDB, such as Japan, Kyoto.
+I don't know where the list of names which IPInfoDB uses,
+but I think you can get some about it from [the list in correcting form].
+
+### Tips : Location is Cached in Cookie
+
+Once a visitor has accessed to a web site, the location is cached in Cookie.
+In other words, if a visitor has accessed from NewZealand for the first time,
+then he or she moved to Austria, and access again to the website,
+our module says that the visitor is accessing from NewZealand.
+
+## Device (code/condition/Device.php)
+
+Device is a condition that which browser and operating system a visitor is using.
+We consider the case that you are distributing an application for Windows and Mac.
+By using this condition, you can show download link of Windows version,
+when the visitor is using Windows.
+
+e.g.
+```
+Device: Windows
+```
+```
+Device: Mac OS X
+```
+
+For getting browser and operating system of visitors, we uses User_agent.php which is from CodeIgniter framework.
+You can see the name list of OSs and browsers at ``thirdparty/useragent/user_agents.php``
+
+## NewComer (code/condition/NewComer.php)
+
+NewComer is a condition that whether a visitor comes to this site for the first time or not.
+For example, you can show welcome message for new comers by using this condition.
+
+e.g.
+```
+NewComer: true
+```
View
2  docs/en/getting-started/getting-started.md
@@ -44,7 +44,7 @@ You need to some set the following API keys to use the respective thirdparty ser
### AudienceTypes (mysite/_config/audiencetype.yml)
The module personalizes content based on [AudienceTypes](https://github.com/yukiawano/sscpmodule/blob/master/docs/en/topics/audience-type.md).
-An AudienceType is a collection of conditions.
+An AudienceType is a collection of [conditions](https://github.com/yukiawano/sscpmodule/blob/master/docs/en/conditions.md).
You can define AudienceTypes in YAML like this:
View
1  docs/en/index.md
@@ -5,3 +5,4 @@
### Developers
[What is CPEnvironment](https://github.com/yukiawano/sscpmodule/blob/master/docs/en/topics/what-is-cpenvironment.md)
+[Available Conditions](https://github.com/yukiawano/sscpmodule/blob/master/docs/en/conditions.md)

2 comments on commit bf88a2f

@chillu

Would be good to start the docs with a glossary of terms: "Snippet" vs. "Block" vs. "BlockHolder"

Please sign in to comment.
Something went wrong with that request. Please try again.