question action remove DIV style

How do I do this.

EE has the option to ‘listen’ to CSS selectors. Like I could change background-colour from entree 1 entree 2 etc.

This tag is called {switch} which has to be added as class to a DIV. I know how to hand code that, but how do I do that in Freeway?

I tried this remove DIV style action, but did not get the wanted result.


ORIGINAL 

{exp:channel:entries channel="news" limit="5" show_future_entries="yes" sort="asc"}
				<div class="f-x2" style="position:relative; width:75%; margin-bottom:20px; background-color:#fff; border-bottom:solid #ddd 1px; overflow:visible; ">
					<h1>{title}</h1>
					
					{text}
				</div>
				{/exp:channel:entries}
				
WITH ACTION REMOVE DIV STYLE


{exp:channel:entries channel="news" limit="5" show_future_entries="yes" sort="asc"}
				<div class="f-x2">
					<h1>{title}</h1>
					
					{text}
				</div>
				{/exp:channel:entries}

WITH OPTION ADD STYLE BACK AS CSS


{exp:channel:entries channel="news" limit="5" show_future_entries="yes" sort="asc"}
				<div class="f-x2 maincontent8smk1">
					<h1>{title}</h1>
					
					{text}
				</div>
				{/exp:channel:entries}


DESIRED


{exp:channel:entries channel="news" limit="5" show_future_entries="yes" sort="asc"}
				<div class="{switch='one|two'}" style="position:relative; width:75%; margin-bottom:20px; background-color:#fff; border-bottom:solid #ddd 1px; overflow:visible; ">
					<h1>{title}</h1>
					
					{text}
				</div>
				{/exp:channel:entries}

dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Try the AddSelector or Classify Actions, either of which may help you
with this.

Walter

On Apr 26, 2011, at 1:26 PM, atelier wrote:

How do I do this.

EE has the option to ‘listen’ to CSS selectors. Like I could change
background-colour from entree 1 entree 2 etc.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter

You are the man, AddSelector did the trick.
Excuse me my ignorance, but how do I make the .one and .two class also switch the background-color of the font inside that DIV?

<div class="{switch='one|two'}" style="position:relative; width:75%; margin-bottom:20px; border-bottom:solid #ddd 1px; overflow:visible">

dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

.one { background-color:#DDDDDD }
.two { background-color:#EEEEEE }


p { color:#333; letter-spacing:0.36px; background-color:#fff; line-height:1.5 }

sorry forgot the css code as generated by FW.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You would need to create a second style rule that targets that text. I
am presuming that the text is in a p tag inside the parent DIV, right?
If so, does it have any inline style rules that need to be overridden?
If the text inside the DIV is unadorned, you can easily make rules
that look like this:

.one p { ...
.two p { ...

and whatever color or background attributes you add to them will apply
through the magic of the CSS cascade. In fact, as long as that text is
relatively unstyled, you may not need to even do this, it should just
work, because background attributes are inherited and pass-through un-
styled elements.

Walter

On Apr 26, 2011, at 2:12 PM, atelier wrote:

Walter

You are the man, AddSelector did the trick.
Excuse me my ignorance, but how do I make the .one and .two class
also switch the background-color of the font inside that DIV?

<div class="{switch='one|two'}" style="position:relative; width:75%;  
margin-bottom:20px; border-bottom:solid #ddd 1px; overflow:visible">

dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Walter, it works.

:slight_smile:

I needed two extra rules actually. Also for the a.
My p tag has background color, did not get overruled by the swich style rule. My H1 H2 etc tags do enherit the background.

Should I therefore add the background-color to my body tag, and remove it from my p tag? I’ll try that one.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi you coul also have used the advance-inline-styles mover action which allows you to do the same sort of thing including multiple classes and removing the inline style ect

http://www.actionsforge.com/projects/view/117-advance-inline-styles-mover

max


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options