Commit 6e2a8b2d authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

tweaks

parent 24a23357
......@@ -94,6 +94,44 @@ The conception of costum based on of communecter's parameters is a basic version
| scopes | _object_ with entry cities or zones to be focus on specific geographical area |
<br/>
# generic COstum (templates)
Imagine having created a costum (templateSlug)
and you want to reuse exactly the same in a different context
This is possible with *generic costums* with a parent element(elementSlug)
we can then use specific things from the parent element
The process means reusing a costum json file by many elements(organization, project, event ...) while using a costum attribute in the element's data map.
on any element data, minimum :
```
_id : "xxxxxelementID",
slug : "elementSlug",
costum : {
//this is the parent costum , that can be overloaded
slug : "templateSlug"
}
```
all attributes inside this costum attribute will be identical to the parent
```
_id : "xxxxxelementID",
slug : "elementSlug",
costum : {
slug : "templateSlug",
css : {
"font" : {
"url" : "/font/mayenneDemain/yourChosenfont.ttf"
},
}
}
```
To see the costum we use the slug of the element
http://127.0.0.1/ph/costum/co/index/slug/xxxxSlugOfElement
This loads the costum based on the parent costum slug
and in this process overloads any existing identical attributes
# Features
- build you own `personnalised interface`
......
......@@ -66,16 +66,18 @@ class Costum {
$el = Slug::getElementBySlug($slug, $elParams );
$tmp['contextType'] = $el["type"];
$tmp['contextId'] = $el["id"];
if(@$el["el"]["costum"]){
$id = (@$el["el"]["costum"]['id']) ? $el["el"]["costum"]['id'] : $el["el"]["costum"]['slug'];
if(isset($el["el"]["costum"])){
$id = (isset($el["el"]["costum"]['id'])) ? $el["el"]["costum"]['id'] : $el["el"]["costum"]['slug'];
}
else {
//generate the costum tag on the element with a default COstum template
//can be changed in the costum admin
$id = "cocampagne";
$id = "customBuilder";
}
}
//ex : http://127.0.0.1/ph/costum/co/index/id/xxxx/type/organizations
//l'id et le type permettent de retrouver un élément
else if(isset($type) && isset($id)){
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment