Closed chredd closed 9 years ago
That makes sense... and it doesn't require too much code either. Look into ArlimaArticle.js and the function updateItemPresentation().
You can now declare the border color when calling arlima_register_format()
https://github.com/victorjonsson/Arlima/wiki/Article-formats#registering-and-deregistering-formats
Do you think it's enough if the formats has this feature? I'm thinking that it will get bit distracting if both formats and templates applies different colors to the article item
Great!
There is some value on having the template as CSS class as well since you might either one of them in your implementation. So sometimes templates are important and sometimes formats are. Just adding the CSS classes let me as a developer decide how I should format them visually in Arlima admin.
Does this make any sense?
Yes, I think you're absolutely right. Your'e either a heavy user of formats, or a heavy user of templates...
You don't register the templates one by one so the css has to be inserted with an inline style-tag, or something...
Let's say you have the template ..esport/template/sport-teaser.tmpl
then the class template-sport-teaser
would be added to the article item. The css could be inserted with something like this:
add_action('arlima_admin_scripts-main', function() { ?>
<style>
.article.template-sport-tease {
border: pink dotted 4px;
}
</style>
<?php });
That sounds like a good idea. Also makes it really clear on what you are targeting.
Let me know if it works as expected. Notice that the template classes is prefixed with template-
but that format classes is not prefixed with anything.
I will try this out today.
I works super swell! In order to making it clearer it would be great if the formats are prefixed as well tho. IE: class="article template-image-background format-serif-title". What do you think?
Edit: guessing that this could be done by just adding as a prefix it here: https://github.com/victorjonsson/Arlima/blob/145c22c75541427ad24cdaefda22cb452ed02d06/js/arlima/dev/ArlimaArticle.js#L105
:+1:
Makes it easier to visually show which format and/or template that is being used for a teaser. Let's say that my format "Featued teaser" should have a red bar (or background), the format "Standard" should have a blue bar (or backbround, or whatever) to make it easier for editors to determine how the teaser looks like without opening it in preview.
It would make i possible to create something like this (ignore the red line at the end):