Thanks! But there is still something I doing the wrong way. If I introduce the following lines in the XWiki.StyleSheetExtension object code...
#if($context.action == 'view') #mainContentArea { margin-top: -35px; padding: 0px 0px; } #else #mainContentArea { margin-top: 100px; padding: 0px 0px; } #end I do get a 100px top margin when viewing the page... http://portal.idisantiago.es I'm afraid I'm wrongly using $context.action, but I don't understand why! Help, please! Thanks, Ricardo On Wed, Aug 26, 2015 at 1:14 PM, Thomas Mortagne <thomas.morta...@xwiki.com> wrote: > "{{velocity}}" is wiki syntax to indicate that you want to insert some > Velocity. When you enable "parsing" the whole content become Velocity > already. > > On Wed, Aug 26, 2015 at 1:04 PM, [IDIS Technical Secretariat] Ricardo > Rodríguez <ricardo.rodrig...@idisantiago.es> wrote: > > Thanks! So simple, so nice... > > > > Still, I'm not able to get it working yet... Here what I'm trying to > get... > > > > {{velocity}} > > #if($context.action == 'view') > > #mainContentArea { > > margin-top: -35px; > > padding: 0px 0px; > > } > > #end > > {{/velocity}} > > > > I didn't get this code read while within the Velocity IF structure. In > the > > log, I'm getting this... > > > > 2015-08-26 13:00:13,926 [ > > http://localhost:8080/xwiki/bin/ssx/Home/WebHome?language=en] WARN > > o.x.v.i.DefaultVelocityEngine - Deprecated usage of getter > > [com.xpn.xwiki.api.DeprecatedContext.getAction] in > 360:xwiki:Home.WebHome@6 > > ,14 > > > > Please, what am I doing wrong? Thanks! > > > > Ricardo > > > > > > On Wed, Aug 26, 2015 at 10:52 AM, Thomas Mortagne < > thomas.morta...@xwiki.com > >> wrote: > > > >> You can enable Velocity in StyleSheetExtension content (the "Parse > >> content" property). > >> > >> The problem is that it means you need to disable caching as otherwise > >> the browser will stick with the first version it downloaded. > >> > >> On Wed, Aug 26, 2015 at 10:32 AM, [IDIS Technical Secretariat] Ricardo > >> Rodríguez <ricardo.rodrig...@idisantiago.es> wrote: > >> > Hi! > >> > > >> > Please, is it possible to customise a XWiki.StyleSheetExtension > object to > >> > apply different properties to different actions in the same page? > >> > > >> > For instance, I would like to use different #mainContentArea { > >> margin-top: > >> > ; } values when viewing, or editing a page, i.e. Home.WebHome, or > >> creating > >> > new pages in that Home space. > >> > > >> > Thanks for your help! > >> > > >> > Ricardo > >> > > >> > -- > >> > Ricardo Rodríguez > >> > Research Management and Promotion Technician > >> > Technical Secretariat > >> > Health Research Institute of Santiago de Compostela (IDIS) > >> > http://www.idisantiago.es > >> > _______________________________________________ > >> > users mailing list > >> > users@xwiki.org > >> > http://lists.xwiki.org/mailman/listinfo/users > >> > >> > >> > >> -- > >> Thomas Mortagne > >> _______________________________________________ > >> users mailing list > >> users@xwiki.org > >> http://lists.xwiki.org/mailman/listinfo/users > >> > > > > > > > > -- > > Ricardo Rodríguez > > Research Management and Promotion Technician > > Technical Secretariat > > Health Research Institute of Santiago de Compostela (IDIS) > > http://www.idisantiago.es > > _______________________________________________ > > users mailing list > > users@xwiki.org > > http://lists.xwiki.org/mailman/listinfo/users > > > > -- > Thomas Mortagne > _______________________________________________ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users > -- Ricardo Rodríguez Research Management and Promotion Technician Technical Secretariat Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users