Matteo Pelucco wrote:

Nils Breunese ha scritto:
Matteo Pelucco wrote:

BUT there is also another simpler way.

You can add the vars you need extending a dialog.
Simply add a new tab to the STK pageDialog. In that tab you can place all the variables you need. They will be left empty by default. In this case, you can avoid to write java code and you will obtain the same result.
I also tried this approach (before actually) and I have another round of questions.

1. For the site-wide statistics settings I added a new tab under Templating Kit > Dialog Definitions > pages/home/stkHomeProperties. Does that make sense or would you place a dialog for site-wide settings elsewhere?

The point 2 is a better option, I think...

What do you mean exactly?

2. Actually, I only created a reference there and created the actual dialog nodes under /modules/<module-name>/dialogs/tabSitestat. Is that recommended over putting the tab directly in the STK tree?

Just for sharing purpose.
If you intend to use that tab somewhere else, it is a good practice :-)
So you can include it in stkHomeProperties, stkPageProperties, ...

The dialog is for site-wide settings, so I don't intend to use that tab anywhere else but under stkHomeProperties. I guess it doesn't really matter then.

4. The most important question right now: I can set site-wide settings using this dialog, but where do I put the JavaScript code? This code should be included in every page and needs to be able to access to these settings, so I believe I can't put it under Resources > templating-kit/js/all because there I have no access to site/page-specific settings. Or am I wrong about that? I would really appreciate some guidance on this point.

I think, as Gregory suggested, that you can extend STK main.ftl including a custom template.

Extend? You mean replace main.ftl with a version that includes my custom template? That's what I did for now, and that works. But it feels dirty.

Nils Breunese.

----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to