Hi Matt & Richard, Actually you already have such a site parameter map, just a bit hidden lower down in the site's bean structure. So you don't need to adapt the Site class to achieve this: As STK's template renderer merges the site's template-prototype (site/template/prototype) with the concrete template definition, both are represented by the same bean: info.magnolia.module.templatingkit.templates.STKTemplate
For the sites prototype its just a bean, for the concrete template of course the RenderableDefiniton at the same time. As it implements the info.magnolia.module.templating.AbstractRenderable you have the parameters map in the concrete template (and paragraph) as in the site definitions prototype. So you should be able to do something like: site/template/prototype/parameters/fooParameter The interesting part about this prototypes parameters is, that (as mentioned) it is merged together with the concrete template definition by the stk renderer. Meaning that this parameter is automatically available in any template script by its 'def' (definition object). So setting on site.template.prototype.parameters.fooParameter would be accessible within the template script as def.fooParameter or def.parameters.fooParameter. And as the definition is also supplied to the model, you have the parameter there also by the definition. And any concrete template could overwrite this site parameter also, which could bring in even more dynamics (or drawbacks). But if you want to ensure, you don't access an overridden parameter value, you just access directly the site definition by site.templates.prototype.parameters.fooParameter Cheers, Christian On Nov 3, 2011, at 4:59 PM, Dertinger, Matthew wrote: > Hi Richard, > > Thanks for the great info! :) For Twigs, I’m trying to stay as close as > possible to the STK implementation, there’s currently a JIRA issue ( > http://jira.magnolia-cms.com/browse/MGNLSTK-575 ) that I’m hoping will be > included in the STK 2.0 release. > > Cheers, > Matt > > -- > <image.png> > MATT DERTINGER SOLUTIONS ARCHITECT, INTERACTIVE R&D, CE DETROIT > CAMPBELL EWALD, 30400 VAN DYKE AVENUE, WARREN, MI 48093-2316 > O: 586 558 7286 > > > From: "Unger, Richard" <[email protected]> > Reply-To: Magnolia Dev-List <[email protected]> > Date: Thu, 3 Nov 2011 15:27:01 +0000 > To: Magnolia Dev-List <[email protected]> > Subject: AW: [magnolia-dev] STK 2.0 - introduce opengraph meta tags ? > > Hi Matthew, > > About the arbitrary parameters: we needed this functionality, it was actually > very easy to implement: > > 1. Create a subclass of info.magnolia.module.templatingkit.sites.Site > 2. Add your parameters, or simply add a HashMap with appropriate getters > and setters to your subclass. > 3. Deploy your class in a module (or simply in a JAR file) in the > Magnolia Webapp. > 4. Set the "class" attribute on the site definition to refer to your > implementation. > 5. Configure your attributes under the site definition, and they will be > set in the Site via content2bean. > 6. Refer to your attributes from templates using freemarker like > def.site.myattribute > > Regards from Vienna, > > Richard > > -----Ursprüngliche Nachricht----- > Von: [email protected] [mailto:[email protected]] > Im Auftrag von Dertinger, Matthew > Gesendet: Donnerstag, 03. November 2011 15:56 > An: Magnolia Dev-List > Betreff: Re: [magnolia-dev] STK 2.0 - introduce opengraph meta tags ? > > Hi Greg, > > I've actually implemented both the apple-touch-icons and the opengraph stuff > in Twigs. I can't remember if I've committed in the opengraph stuff yet, but > I'll look right now, and if I haven't I'll commit it now. > > One thing that I've been waiting for the Magnolia 4.5 release for is the > ability to assign arbitary parameters to site definitions. This would allow > us to define the xmlns, facebook and opengraph meta data at the site level. > > Let me know what you think if you have a chance to check the Twigs code out. > > Cheers, > Matt > > > > From: Grégory Joseph <[email protected] > > <mailto:[email protected]> > > > Reply-To: Magnolia Dev-List <[email protected] > > <mailto:[email protected]> > > > Date: Thu, 3 Nov 2011 13:11:24 +0100 > > To: Magnolia Dev-List <[email protected] > > <mailto:[email protected]> > > > Subject: [magnolia-dev] STK 2.0 - introduce opengraph meta tags ? > > > > Hey there, > > > > Does anyone know about the opengraph og:image tags ? I just found out > > that when linking to our forum on Facebook, and ~random image is used > > (which can be ugly.. since in this case it used the "yahoo" icon from > > the login form) > > > > So while googling for this, I found out the following: > > > > http://stackoverflow.com/questions/5888638/facebook-like-button-fetche > > <http://stackoverflow.com/questions/5888638/facebook-like-button-fetche> > > s-wrong- > > image > > https://developers.facebook.com/docs/opengraph/ > > <https://developers.facebook.com/docs/opengraph/> > > > > Seems easy enough from an HTML point of view - is this something we > > could add to STK 2.0 ? I guess the question will be to determine where > > we get the info from.. extra dialog fields or not... > > > > That also made me think about another related thing we could try to > > tackle - the infamous favico, and the similar "apple-touch-icon". Thoughts ? > > > > Cheers, > > > > -greg > > > > > > ---------------------------------------------------------------- > > For list details, see: > > http://www.magnolia-cms.com/community/mailing-lists.html > > <http://www.magnolia-cms.com/community/mailing-lists.html> > > Alternatively, use our forums: http://forum.magnolia-cms.com/ > > <http://forum.magnolia-cms.com/> To > > unsubscribe, E-mail to: <[email protected] > > <mailto:[email protected]> > > > ---------------------------------------------------------------- > > > > > > ---------------------------------------------------------------- > For list details, see: > http://www.magnolia-cms.com/community/mailing-lists.html > <http://www.magnolia-cms.com/community/mailing-lists.html> > Alternatively, use our forums: http://forum.magnolia-cms.com/ > <http://forum.magnolia-cms.com/> To unsubscribe, E-mail to: > <[email protected] > <mailto:[email protected]> > > ---------------------------------------------------------------- > > > > > ---------------------------------------------------------------- > For list details, see: > http://www.magnolia-cms.com/community/mailing-lists.html > Alternatively, use our forums: http://forum.magnolia-cms.com/ > To unsubscribe, E-mail to: <[email protected]> > ---------------------------------------------------------------- > > > > ---------------------------------------------------------------- > For list details, see: > http://www.magnolia-cms.com/community/mailing-lists.html > Alternatively, use our forums: http://forum.magnolia-cms.com/ > To unsubscribe, E-mail to: <[email protected]> > ---------------------------------------------------------------- ---------------------------------------------------------------- For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
