Colorpicker Use Example
At the request of candyman on the Textpattern Forums I put together an example of how to use the color information stored with articles using my admin side colorpicker plugin.
At the request of candyman on the Textpattern Forums I put together an example of how to use the color information stored with articles using my admin side colorpicker plugin.
You can add the following to the head section of your page replacing the custom field name with which ever custom field you are using for your colorpicker.
<txp:if_individual_article>
<txp:if_custom_field name="custom1" val="">
<txp:else/>
<style type="txt/css">
span.highlighted{background-color: <txp:custom_field name="color" escape=""/>;
</style>
</txp:if_custom_field>
</txp:if_individual_article>
and then highlight a portion of your article by surrounding it in a span with a class using textile like this:
designed to display a %(highlighted)different color% for each article.
resulting in the following html
designed to display a
<span class="highlighted">different color</span>
for each article.
and showing the selected text highlighted in the chosen color.




jump to the comment form ↓