Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Enable Razor within CSS
MartinS
#1 Posted : Sunday, August 14, 2011 10:12:15 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 7/25/2011(UTC)
Posts: 55
Location: UK
One of the things we do quite often is re-skin sites for customers from a mainly templated design.

It would be useful if we could commonise some of the values used repeatedly throughout css into label values, so that they only need to be changed in one place.

Is it possible that you could enable Razor parsing in the CSS files? Or have you found a way to do anything similar previously?

CSS variables are something that developers have been asking after for as long as I can remember, but I don't think there's a more generic solution as yet?

Thanks,

Martin
MartinS
#2 Posted : Sunday, August 14, 2011 6:32:54 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 7/25/2011(UTC)
Posts: 55
Location: UK
Actually, I don't seem to be able to access the site labels from either HTML added within a page, or from HTML blocks either. We're trying to ensure that customers can maintain the text content of their sites, it makes sense to make as wide use of labels as possible, so could this be added please?

Just adding functionality for using labels, if nothing else, would be good.

Thanks,

Martin
jifeng
#3 Posted : Monday, August 15, 2011 1:07:31 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
1. It is impossible to use the razor in CSS style files. But you can write the css sytles included in the template.

2. Sorry, it is impossible to embed the label in the HTML content and HTML blocks.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Armand
#4 Posted : Monday, August 15, 2011 8:31:39 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 7/18/2011(UTC)
Posts: 79
Location: UK
If it's not possible to use Razor within those areas, could you at least add your own label replacement syntax, as kind of a mail merge? All you'd need to do is a quick RegEx on the content before building it into the page output..

I'm sure lots of other people would appreciate this.
jifeng
#5 Posted : Monday, August 15, 2011 9:22:52 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
yes, I think must enhance this part. There are many dynamic values must be replaced in the HTML content:

1. The file virutal path.

2. insert a page url.

3. label text.

....


But they can be done in the view, so we must evaluate it.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Armand
#6 Posted : Monday, August 15, 2011 12:13:05 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 7/18/2011(UTC)
Posts: 79
Location: UK
My logic was that if you have parts that you want content editors to maintain, without the risk that giving them security access to views might allow them to break code in another view..?
jifeng
#7 Posted : Tuesday, August 16, 2011 1:25:07 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
You reminded me, I think we can use the Nvelocity template engine in the Html content and html block. It is security and pure html code, you can use the api we exposed.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Armand
#8 Posted : Tuesday, August 16, 2011 8:41:15 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 7/18/2011(UTC)
Posts: 79
Location: UK
Hi Jifeng,

Is that Nvelocity template engine already in place? Do you have any examples of how to use it?

Thanks.
jifeng
#9 Posted : Tuesday, August 16, 2011 9:07:58 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
Kooboo cms have been supported to use nvelocity in the layout and view. You can download the Template_Engines.zip, and place the nvelocity provider files into bin folder.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Armand
#10 Posted : Tuesday, August 16, 2011 10:53:05 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 7/18/2011(UTC)
Posts: 79
Location: UK
Can nvelocity already be used in the html blocks or will you need to make changes to allow that?
jifeng
#11 Posted : Wednesday, August 17, 2011 2:37:33 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
I just said it is possible, but did not support that. We must evaluate it, because the nvelocity does not support in medium trust level.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.118 seconds.