I’m trying to create basic components for my websites in order to simplify changes to the look and feel. Let’s use Headings as an example. Unless I’m mistaken, the only global control I have over them is the font library defining one as “heading”. When I change the font once, it propagates to the entire site. I want the same global control over headings using components. I created a component and used the below JSON (from another post). Instead of allowing choices like H1, H2 (in the example below) I’ll make a component for each so I have global control to implement style changes for each heading type. I think the JSON below covers most of the variables, but I get stuck on implementing the dynamic content (i.e. putting {{dc:p:headContent}} in the header content to have a starting point for what the header says, but the ability to edit that on the page, because obviously every header will have different text. I cannot find a tutorial on this. It would be great if there was a component library just like there are templates. Maybe I missed that, but it would be great to have that library just like Header, Footer, Page library. If there isn’t one, can you help me with this one? I want to also have a section component so there’s global control of the layout parameters (like padding) and the background color or image. I know there is some of this in the documentation, but again, I’'m getting stuck on the dynamic content part.
{
"headContent" : {
"label" : "Heading",
"type" : "group",
"params" : {
"text" : {
"label" : "Text",
"type" : "text-editor",
"initial" : "Heading"
},
"href" : {
"label" : "URL",
"type" : "text",
"placeholder" : "Header Text"
},
"target" : {
"type" : "choose",
"label" : "target",
"initial" : "_self",
"options" : [
{"label" : "Intern", "value" : "_self"},
{"label" : "Extern", "value" : "_blank"}
]
}
}
},
"HeadTag" : {
"label" : "Tag",
"type" : "choose",
"initial" : "h1",
"options" : [
{ "value" : "h1",
"label" : "H1" },
{ "value" : "h2",
"label" : "H2" },
{ "value" : "h3",
"label" : "H3" }
]
},
"HeadSize" : {
"label" : "Size",
"type" : "choose",
"initial" : "H1",
"options" : [
{ "value" : {
"FontSize" : "2.5em",
"Height" : "1.2"
},
"label" : "H1" },
{ "value" : {
"FontSize" : "2em",
"Height" : "1.2"
} ,
"label" : "H2" },
{ "value" : {
"FontSize" : "1.6em",
"Height" : "1.2"
} ,
"label" : "H3" }
]
},
"headDesign" : {
"label" : "Design",
"type" : "group",
"params" : {
"textColor" : {
"label" : "Text Color",
"type" : "color-pair",
"initial" : {
"base" : "#000000",
"alt" : "#FFFFFF"
}
},
"topMargin" : {
"label" : "Margin Top",
"type" : "dimension",
"initial" : "0em",
"slider" : true,
"keywords" : [ "auto" ],
"units" : [ "px", "em", "rem" ],
"isVar" : true
},
"rightMargin" : {
"label" : "Margin Right",
"type" : "dimension",
"initial" : "0em",
"slider" : true,
"keywords" : [ "auto" ],
"units" : [ "px", "em", "rem" ],
"isVar" : true
},
"bottomMargin" : {
"label" : "Margin Bottom",
"type" : "dimension",
"initial" : "2em",
"slider" : true,
"keywords" : [ "auto" ],
"units" : [ "px", "em", "rem" ],
"isVar" : true
},
"leftMargin" : {
"label" : "Margin Left",
"type" : "dimension",
"initial" : "0em",
"slider" : true,
"keywords" : [ "auto" ],
"units" : [ "px", "em", "rem" ],
"isVar" : true
}
}
}
}