One solution (which I did yesterday, which got me thinking) is to put a div around your content, set it to a class, and make a change to your news stylesheet to customize the elements in your div, but it's a pain to have extra one-off styles in your stylesheet lying around, if you're never going to use them again.
In short, we will be creating an "overridestyle" field definition in News -> Field Definitions, editing the News Detail Template to capture this field, and editing the site template to include this info, if available. This technique is a slight modification of the method to put the news title in the page
NOTE: This method will only work if $config['process_whole_template'] is false in config.php (default). This ensures that the body is processed before the head, so that variables set in {content} can be used in the
Step 1: Create a new field definition
* Go to News -> Field Definitions and click on "Add Field Definition"
* Name: overridestyle
* Type: Text Input (I tried text Area, but it gets WYSIWYGged, also Text Input is more unobtrusive, if not using it)
* Max Length: 255 should be enough
Step 2: Update News Detail Template
* Go to your detail template and enter the following at the end:
Code: Select all
{assign var='overridestyle' value=$entry->overridestyle}
Step 3: Update Your Site Template
* Edit your site template and place the following under your {stylesheet} tag:
Code: Select all
{if isset($overridestyle)}
<style type="text/css">
{$overridestyle}
</style>
{/if}
That's it! Now edit a news article and put something like "p {color: green} a {text-decoration: none}" (without the quotes) in your overridestyle field and test it out!
This can be used for other things as well (with minor modifications), such as custom javascript for an article.
This solution isn't optimal if you have a site with many users, and you don't want your news staff editing menu CSS, etc.. It might be possible to adjust your form template to only show this field if you are in a particular group, if you can see group info in smarty.. not sure.
Enjoy!