Monday, 1 June 2009

Applying CSS Conditionally

It may happen that you have an exception on one or more of your pages where your styling deviates from standard. In addition to that, you may want to apply your style conditionally. You have several choices in order to solve that problem:

1. make changes to your css file
2. create a css file within your workspace and reference it in your page template
3. create an additional template for your new style

However, this reqiures severals steps and could be a problem in some cases:

- you are not managing your HTTP Server and your dba's need months in order to accept such a small change

- you need to make changes to your page templates

- you need to create an additional template (region template, report template, ...)

Sometimes you need to go that way but there are also situations where you could solve that as in this example in my Demo Application. Using Firefox and Web Developer Toolbar you can easily find out the classes and their properties referenced in your template. You can adjust those properties to whatever you need and put that code into the header text of your page:

<style>
.t10ReportsRegion .t10RegionBody {background-color:#E2E5EA;}
.t10ReportsRegion .t10ButtonHolder {background-color:#E2E5EA;}
</style>

and the style will be applied only on that particular page. This will overwrite the style applied through the class with the same name in your css file.

If you need to apply your style conditionally, you can do the following:

1. create a region with the highest sequence and do not apply any template to it,

2. put your code in the region source of that region

3. change the region to render conditionally


20 comments:

Term Papers said...

I have been visiting various blogs for my term papers writing research. I have found your blog to be quite useful. Keep updating your blog with valuable information... Regards

Unknown said...

I've a applications containing almost 200 pages and in every pages have some field which is not updatable. now I'm trying to apply a one css class for all of my non updatable item but i'm stuck. Could you please help me?

Unknown said...

this is really too useful and have more ideas from yours. keep sharing many techniques. eagerly waiting for your new blog and useful information. keep doing more.

School Signs UK

Unknown said...

lot of things learnt from your blog. got more ideas for us. wonderful tips makes from yours. Executing and testing our status very helpful one.
IELTS coaching in chennai

Tutorials said...

Very Informative and interesting blog!  Primavera course online  Best primavera p6 training online  

99 Digital Academy said...

Nice to read this Article, Thanks for the nice information. Here I have a suggestion that if your looking for the Best Digital Marketing Institute in Pitampura Then Join the 99 Digital Academy. 99 Digital Academy offers an affordable Digital Marketing Course in Pitampura. Enroll Today.

Mallela said...

Thanks for posting the best information and the blog is very helpful.digital marketing institute in hyderabad

Deekshitha said...

Informative blog
best digital marketing institute in hyderabad

CloudLearn ERP said...

I'm highly dazed with the quality of the content which you have penned down. This is a splendid article! Your article has all the necessary information on the respective topic.
Data Science training in Mumbai
Data Science course in Mumbai
SAP training in Mumbai

Aishwariya said...

Thank you for sharing your article. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the same to other forums. Amazon Web Services Training in Chennai

Chartered Accountants in Bangalore said...

https://salsabeelahmedandco.com/
Very Informative and useful... Keep it up the great work. I really appreciate your post.

https://salsabeelahmedandco.com/company-registration-in-bangalore/
https://salsabeelahmedandco.com/ca-firms-in-bangalore/
https://salsabeelahmedandco.com/accounting-services-in-bangalore/
https://salsabeelahmedandco.com/gst-consultants-in-bangalore/
https://salsabeelahmedandco.com/public-limited-company/
https://salsabeelahmedandco.com/private-limited-company-in-india/
https://salsabeelahmedandco.com/one-person-company-in-india/
https://salsabeelahmedandco.com/partnership-firm-in-bangalore/
https://salsabeelahmedandco.com/limited-liability-partnership-llp/

Data Science Chennai said...

I truly appreciate just perusing the entirety of your weblogs. Just needed to educate you that you have individuals like me who value your work. Unquestionably an extraordinary post. Caps off to you! The data that you have given is exceptionally useful.data science training in chennai

Academy of IELTS said...

IELTS is known for the best IELTS coaching in Ahmedabad and consistently successful results. High Band Score 8 and Average Band Score Minimum 6.8 are maintained so that you can get more information about IELTS Coaching Institute, Ahmedabad.

MindQ said...

Software Development Engineer Training SDET is an emerging role in the present scenario, this role needs an IT professional that can handle development as well as testing effectively. The entire software development process is handled from developing to the testing phase. So this role has high priority in the industries.

Unknown said...

Very nice blog and articles. I am realy very happy to visit your blog. Now I am found which I actually want. I check your blog everyday and try to learn something from your blog. Thank you and waiting for your new post. data science course in surat

Unknown said...

This is really very nice post you shared, i like the post, thanks for sharing.. data scientist course in surat

Data Science said...

Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. A debt of gratitude is in order for sharing.business analytics course in kolhapur

Data Science said...

Extremely overall quite fascinating post. I was searching for this sort of data and delighted in perusing this one. Continue posting. A debt of gratitude is in order for sharing.data science course in kolhapur

Unknown said...

Great to become visiting your weblog once more, it has been a very long time for me. Pleasantly this article i've been sat tight for such a long time. I will require this post to add up to my task in the school, and it has identical subject along with your review. Much appreciated, great offer.data analytics course in ghaziabad

Pranisha said...



Are you looking for the best Azure Training in Chennai? Here is the best suggestion for you, Infycle Technologies the best Software training institute in Chennai to study Azure platform with the top demanding courses such as Graphic Design and Animation, Cyber Security, Blockchain, Data Science, Oracle, AWS DevOps, Python, Big data, Python, Selenium Testing, Medical Coding, etc., with best offers. To know more about the offers, approach us on +91-7504633633, +91-7502633633.