42 Posts
IBeRKa
9 years ago
3
Topic

Ahoy!

After having searched the forum and the internet, I failed to find a solution for my task. Maybe one can help?

I convinced my customer to rely on seblod for the special kind articles he wants to offer on his website. He agreed and it works nicely so far.

But one of the requirements is that he wants to be able to give each of his articles a background color of its own. ftaer all it turned out that he has a pool of 5 to 8 colors and wants to chose one of them for each of his articles.
My idea was to either let him pick a css class from a select box or to enter the class name as normal text like "blue", "red" and so on in a normal text box, but I lack in knowledge about how to bring the picked value then to html markup.

Anyone willing to give a hint aat least?


Thanks in advance!


Get a Book for SEBLOD
154 Posts
WebOne
9 years ago
2
Level 1

Hi, 

Are you wanting to change the articles on the CONTENT VIEW?

Then you can use the HTML typography plugin on the field - something like this :

<style type="text/css">.mydivclass {background-color: *value* !important;}</style>

42 Posts
IBeRKa
9 years ago
1
Level 2

Ahoy, WebOne!

Yyyyyyee ... no, not exactly, I think.

Beside that I've never worked with this plugin (and frankly don't even know how to use it), I don't think, that it could solve my problem.

Maybe it helps when I give you a rough overview over the complete situation:

  • I have a form based on Seblod's articel form - in fact I copied and custoized it.
  • I added some fields I created to this form (yes, it's about events):
    • date
    • time
    • address 1
    • address 2
    • ZIP and town

  • I placed all of them in the "sidebar-a" in Seblod's template seb_one
  • These - and only these - fields in the sidebar-a shall have a certain backgroundcolor (or the sidebar-a itself). In fact I'd like to change a div's background color that has
    • ID "cck[article ID]_sidebody-a" 
    • CSS classes "cck-pos-sidebody-a seb_css3 vertical cck4-deepest"

  • When editing an article in this form, the user should be able to either
    • pick a color or
    • one of nine css class names
      and either the picked color appears in the html markup as a style attribute or the class name will be added to ....

well ... while writing all this I realize that my plan obviously has a basic problem: how could I expect that one field for color or css classname could know automatically WHERE to add the picked color or css name, right? In particular when I need the different colors not just in the content view, but also in the intro view.

Sorry for bothering you with a task in this immature phase of planing it ... I really have to think about it

Thanka for evrything so far, anyway

Regards, Me

1283 Posts
Bucklash
9 years ago
0
Level 3

Hi IBeRKa

My thought would be a simple (or dynamic) select list for the user to choose the class name ie:

color1=color-class-name-1

color2=color-class-name-2 etc

And then, in a position override or position variation add the value:

<div class="$cck("my_color_field")->value"> etc....

Am I close?

Bucklash

Get a VIP membership