I've been researching a solution my problem for a week now, and I just found a way to do it, so I thought I could share here.
I wanted the possibility of applying custom css to individual articles. So, here is what you need to do.
First, go to you folder:
www.site.com/administrator/components/com_content/models/article.xml
Inside of the params group "advanced" (<params group="advanced">) add the following code to add a new parameter to the articles.
Code:
<param name="custom_css" label="custom style" type="textarea" rows="5" cols="30" default="" description="Apply custom css to this article. Ex.: .pageheader {color: #ccc; font-size: 22px;}" size="60" />
Save and close this file.
-----
Now go to your template folder...
www.site.com/templates/templateFolder/html/com_content/article/default.php
And add the following code:
Code:
<?php if ( $this->params->get( 'custom_css' ) ) { ?>
<?php echo "<style>"; ?>
<?php echo $this->params->get( 'custom_css' ); ?>
<?php echo "</style>"; ?>
<?php } ?>
Make sure that you're adding this outside of a <?php ?> tag, for example, in my template I had:
Code:
<?php // no direct access
defined('_JEXEC') or die('Restricted access');
$canEdit = ($this->user->authorize('com_content', 'edit', 'content', 'all') || $this->user->authorize('com_content', 'edit', 'content', 'own'));
?>
<?php if ($this->params->get('show_page_title', 1) && $this->params->get('page_title') != $this->article->title) : ?>
<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<?php echo $this->escape($this->params->get('page_title')); ?>
</div>
<?php endif; ?>
// Here is our Custom CSS code
<?php if ( $this->params->get( 'custom_css' ) ) { ?>
<?php echo "<style>"; ?>
<?php echo $this->params->get( 'custom_css' ); ?>
<?php echo "</style>"; ?>
<?php } ?>
Notice that I put the code I gave you previously after the <?php endif; ?> tag.
After that save and close the file and you'll see the magic. If you don't know what CSS classes you need to customize in your page I highly recommend using Firebug (Firefox Addon).