CG Calendar Templates and Stylesheets

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

CG Calendar Templates and Stylesheets

Post by KitchM »

When one accesses the admin panel and goes to Content>Calguys Calendar and them selects "Templates" near the top right, one gets a multi-tabbed screen.

When one selects the tab entitled "Calendar templates", a list of available templates is shown. It begins with one entitled "Sample". One can now create a new one by using the link that states "New Template from Prototype", and the new one now appears in that list.

At this point an assumption is made by the user. Creating a new one and making it default, forces this one to be the recipient of the GC Calendar module's mechanism.

Interestingly, it does not show up under Layout>Templates. I do not understand that.

However, at some point in time a stylesheet shows up under Layout>Stylesheets. Not sure how this happens either.

What is the relationship between what Calguys Calendar module creates and the templates and CSS created by CMSMS, and how do they differ?

Thanks.
JohnnyB
Dev Team Member
Dev Team Member
Posts: 729
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: CG Calendar Templates and Stylesheets

Post by JohnnyB »

module templates are not related to page templates.
module templates are only for that specific module to output its data.
e.g., a news summary template won't work and won't load a calendar event.
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: CG Calendar Templates and Stylesheets

Post by KitchM »

Thanks, JohnnyB.
It is then assumed that there are muliple templates for each module to allow the module to output its info in different formats.

So then, how does one apply style sheets to these templates?
JohnnyB
Dev Team Member
Dev Team Member
Posts: 729
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: CG Calendar Templates and Stylesheets

Post by JohnnyB »

You apply the CSS to your page template. The same as you would do for any other css. Some modules provide some CSS management inside the module itself and then attach the CSS to your page template automatically for you. If a module does that (like Gallery) it will be part of the module settings/options and templates.
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: CG Calendar Templates and Stylesheets

Post by KitchM »

Maybe I misunderstand something about the mechanism of CMSMS.

Evidently the CMSMS system uses templates colored by stylesheets to take care of any content placed into the database. That's pretty standard stuff. Then the Smarty engine further facilitates the creation of templates with shortcut inserts into templates. Some inserts allow placement of module output, such as in the included News module.

Each template can have multiple stylesheets attached to it. However, unless using Smarty shortcuts, there is only one template for each web page.

1. Are all modules inserted into templates by using Smarty?
2. How are module templates styled if they are only accessable inside the module's inner workings?
JohnnyB
Dev Team Member
Dev Team Member
Posts: 729
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: CG Calendar Templates and Stylesheets

Post by JohnnyB »

1. Are all modules inserted into templates by using Smarty?
2. How are module templates styled if they are only accessable inside the module's inner workings?
I'm not sure that is how to look at how it works. It is less complex that that.

[*]Under Layout, you have Templates.
[*]Inside of each template there will be a {content} tag
[*]That content tag corresponds to each page assigned to that page template.
[*]It loads everything entered into the Content box when adding/editing a page.
[*]The Content box can have a module tag added, e.g., {News}

News articles are just a bunch of data stored in the database (as is the content entered into all modules).

A news article has a post date, title, summary, etc. It does not have HTML or CSS markup.

The news templates like summary, detail, etc., provide the formatting for the news data (HTML).

In other words, without a news summary template, the data would be spit out onto the page in one long line, like this:
"11/03/2014My Cool News Title!This is an interesting news article summary.This article's content is going to be a rather long read. Buckle in for some news excitement."

The News summary template puts all of that data into HTML elements, (p,div, etc) which may have class names assigned to them to allow them to be styled by CSS rules.

HTML: <div class="NewsSummaryTitle">My Cool News Title</div>
CSS: div.NewsSummaryTitle {font-weight:bold}

The CSS rules for any module template can go directly into the main CSS for your page template (Layout, Stylesheet). You write your own CSS for your website.

All of that I described is the standard operating procedure...

There are some exceptions...

Some modules, like FormBuilder, CGCalendar, may provide an example CSS stylesheet and you will find that under Layout, Stylesheets. This can be attached to your page Template just like any stylesheet can be attached. They may work 100% for you. But, remember, it is just an example. It is up to you to manage the CSS and make it look the way you want.

Some modules, like Gallery, have a box to add/edit CSS while editing a Gallery template.

I can't think of any module that has CSS in the inner workings of the module's files...
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: CG Calendar Templates and Stylesheets

Post by KitchM »

Very interesting viewpoint. (I want to think about that a little more.)

But while you mentioned the database, but you didn't mention Smarty, which is an intergral part of CMSMS.
JohnnyB
Dev Team Member
Dev Team Member
Posts: 729
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: CG Calendar Templates and Stylesheets

Post by JohnnyB »

Smarty is just a template system. It doesn't really have anything to do with the content you have stored in the database....

PHP drives the input and output of the data. Smarty is just a way to manage templating in a dynamic way.

http://smarty.incutio.com/?page=SmartyF ... s#basics-1
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: CG Calendar Templates and Stylesheets

Post by KitchM »

Same with the database. It doesn't create the content; it just stores it. But it is a link in the chain.

Actually, I always view Smarty as the thing that lays out the templates, or perhaps standardizes the orderliness of the templates in the language of PHP. It also provides shortcuts to additional special processes the user can define.

By the way, do you mean "dynamic" as opposed to "static"?
Locked

Return to “Modules/Add-Ons”