View Full Version : more conditions
pinbrook
19-Jun-2007, 09:36 PM
I'd like to be able to add a condition for
"contains"
"starts with"
Darren B
19-Jun-2007, 09:39 PM
Late tonight Jo ?
When i sore the title i thought you were asking for more tabs under the Terms and conditions - should have known it would be a design thing ;)
leehack
19-Jun-2007, 09:40 PM
content categories will be your saviour!
pinbrook
19-Jun-2007, 09:45 PM
Yep its late....
My current resolution is to stop work before 8pm- but i relinquished control over Surf-wax so I can only get hold of it for design updates out of hours! I wonder somedays who is the boss?
Darren B
19-Jun-2007, 09:46 PM
The Boss - Always the ones that get weekends off
pinbrook
19-Jun-2007, 09:50 PM
Weekends- there's a joke!!
I just settle for jan, feb and march off :cool: :cool:
should have known it would be a design thing thats all I'm good for, colouring in pretty pictures :)
One final upload then I'm off
TraceyHand
19-Jun-2007, 10:12 PM
thats all I'm good for, colouring in pretty pictures :)
someone's gotta do it
I can barely draw a stickman...that translates into design of any kind :rolleyes:
(I can, however, write music...so I do have *some* creativity lol)
Duncan Rounding
20-Jun-2007, 05:34 AM
I would like an 'else' to go with 'blockif'. It's a pain to have to configure the inverse blockif two times.
pinbrook
20-Jun-2007, 08:34 AM
I would like an 'else' to go with 'blockif'.
Yes me to ...
leehack
20-Jun-2007, 09:29 AM
Me too, nice one Duncan. We constantly have to use more conditions than needed. The blockifs are fantastic though so not a complaint, just a recommendation for the future.
Bruce
21-Jun-2007, 04:36 PM
I have passed on all the requests to the development team.
Kind regards,
zmagyar
22-Jun-2007, 05:39 AM
I'd like to be able to add a condition for
"contains"
"starts with"
The conditions are evaluated by the built in PHP engine. It was the primary reason of the integration not the fancy PHP blocks what is basicaly a side product. :-) It means that you can use any PHP functions in the conditions. Therefore both of the requested conditions can be done easily. There are a few PHP functions which can be used here. The below examples are using stripos for case sensitive comparison. You can also use strpos for non case sensitive and some other functions like strstr and stristr. See PHP documentation for more.
<actinic:block if="false%20%21%3d%3d%20stripos%28%3cactinic%3avariable%20name%3d%22ProductDescription%22%20%2f%3e,%20%22love%22%29">
<b>Lovely product (contains love).</b><br/>
</actinic:block>
<actinic:block if="0%20%3d%3d%3d%20stripos%28%3cactinic%3avariable%20name%3d%22ProductDescription%22%20%2f%3e,%20%22Jane%22%29" >
<b>Written by a Jane (starts with Jane).</b><br/>
</actinic:block>
I would like an 'else' to go with 'blockif'. It's a pain to have to configure the inverse blockif two times.
There were lot of discussions on it during v8 and Express development. In v8 we are using our own parser but in Express we are using a standard XML parser to process the markup. Due to strategical reasons we wanted to sitck with standard XML syntax which ruled out the else statement.
bentleybloke
07-Jul-2007, 09:41 AM
<actinic:block if="false%20%21%3d%3d%20stripos%28%3cactinic%3avariable%20name%3d%22ProductDescription%22%20%2f%3e,%20%22love%22%29">
<b>Lovely product (contains love).</b><br/>
</actinic:block>
<actinic:block if="0%20%3d%3d%3d%20stripos%28%3cactinic%3avariable%20name%3d%22ProductDescription%22%20%2f%3e,%20%22Jane%22%29" >
<b>Written by a Jane (starts with Jane).</b><br/>
</actinic:block>
I just tried pasting the above into a product layout, the ! coding error lit up and nothing happened when I tried adding "love" or "Jane" to the product description.
How is it meant to be applied?
Thanks!
cdicken
09-Jul-2007, 10:03 AM
I'll make sure there's more documentation about this in the help soon. In the meantime, I'll ask Zoltan to come back and check the coding.
zmagyar
09-Jul-2007, 12:10 PM
Apologies. Accidentally I have used functions here which are supported in PHP 5 only. But you can find functions available in PHP 4 (which is the PHP version used by v8) to work around the problem. E.g. the following code is working in v8
<actinic:block if="false%20%21%3d%3d%20stristr%28%3cactinic%3avariable%20name%3d%22ProductDescription%22%20%2f%3e,%20%22love%22%29" >
<br/><b>Lovely product (contains love).</b><br/>
</actinic:block>
<actinic:block if="0%20%3d%3d%3d%20strpos%28%3cactinic%3avariable%20name%3d%22ProductDescription%22%20%2f%3e,%20%22Jane%22%29" >
<br/><b>Written by a Jane (starts with Jane).</b><br/>
</actinic:block>
Please note the latter condition is not case insensitive.
bentleybloke
12-Sep-2007, 07:55 PM
Hi Zoltan, thanks for clearing that up.
Can this be applied using two variables? i.e. the trigger word coming from a variable set at sectionlevel.
So basically: BlockIf ProductDescription contains text from VariableX
Thanks!
zmagyar
12-Sep-2007, 08:47 PM
You are welcome.
Yes, it is possible. You can use arbitary PHP expressions combined with any valid Actinic variable in the if blocks. E.g.
<actinic:block if="false%20%21%3d%3d%20stristr%28%3cactinic%3avariable%20name%3d%22ProductDescription%22%20%2f%3e,%20%3cactinic%3avariable%20name%3d%22MySectionLevelVariable%22%20%2f%3e%29" >
<br/><b>This product's description contains the value of my section level variable</b><br/>
</actinic:block>
This is going to display the text only in case the product description contains the string defined in "MySectionLevelVariable".
I hope it helps.
bentleybloke
13-Sep-2007, 12:18 PM
Thank you Zoltan,
I tried that (a custom variable prefixed with MainSection:: ) but it flashed up Invalid expression. However, thanks to your example I've managed to get it working by switching to advanced view in the Layout Code window.
Seems the possibilities are endless if you've time to learn PHP :o
edit: Having used MainSection::MyVariable and restarting Actinic the error list is lit up with Syntax Error in Objects Condition as the fault. Any ideas?
zmagyar
13-Sep-2007, 01:17 PM
I'm not sure I understand the issue here. Do you mean the condition works properly but it is reported as a coding error?
bentleybloke
13-Sep-2007, 03:25 PM
Yes, it works fine. It just reports the error "Syntax Error in Objects Condition"
It didn't happen until I restarted Actinic.
So, I added encoding="actinic" to MainSection::MyVariable in the condition editor and the error ! has gone out.
Perhaps it's something to do with MainSection::
grantglendinnin
13-Feb-2009, 10:17 AM
Sorry for starting up an old thread, but wondered if the blockif/blockelse features are in v9 - I've looked but can only see the obvious blockif.
What I'm trying to do is with the GeoTrust 'site seal'. The code they give you is to embed a link, with the source as:
SRC=//smarticon.geotrust.com/si.js
Obviously Actinic adds 'acatalog' to this (acatalog///smarticon.geotrust.com/si.js), as it likes to do.
On this thread (http://community.actinic.com/showthread.php?p=171738) - there is a partial fix, which I have already implemented. But I obviously get a JS file being called from a non-secure (http) link on the secured pages (https) on the site.
I was hoping, through use of some blockif's and else's, to effectively create the following using the SSLUsed variable:
blockif SSLUSED {
src=https://smarticon.geotrust.com/si.js
}
else {
src=http://smarticon.geotrust.com/si.js
}
Can some kind sole give me any pointers?
Cheers,
Grant
zmagyar
13-Feb-2009, 10:20 AM
Unfortunatly Actinic doesn't have this feature ATM.
grantglendinnin
13-Feb-2009, 10:25 AM
Unfortunatly Actinic doesn't have this feature ATM.
Thanks for the reply Zoltan. Is this feature likely to be added in the near future?
Furthermore, can you suggest a possible fix for this issue?
Thanks
gabrielcrowe
13-Feb-2009, 12:37 PM
why not use a true false arrangement?
sslused==true
sslused==false
- or -
sslused <> true
leehack
13-Feb-2009, 12:39 PM
There is an SSL switch of somekind in actinic as i have seen it being used, maybe on the GA scripts. Sure there is something that specifies whether SSL is used or not.
gabrielcrowe
13-Feb-2009, 01:23 PM
this is actually a javascript.
function getProtocol()
{
return document.location.protocol;
}
grantglendinnin
13-Feb-2009, 01:59 PM
IsSplitSSLSubdomain seems to be the only SSL related variable which GA uses, so looks like Gabe's idea is the way forward.
For some bizarre reason I was having difficulty with the logic of using == true and == false earlier this afternoon.
Now that I've had some beans on toast, everything seems clear:D
Thanks guys
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.