Tip: Don't execute Data Source if a URL parameter is set
This is an open discussion with 9 replies, filed under General.
Search
smart :)
It’s exciting to see this sort of functionality in the 2.1 sneak peek :)
It’s definitely going to be very useful.
Is this going to be added in 2.1 then? This is probably one of the best tips I’ve found on this forum to be honest, thanks to Brian pointing it out!
Brilliant!
This may be a stupid question… Does anybody know if this has been implemented as a feature?
It hasn't but shouldn't be too much work, and very beneficial IMO
Yep, definitely!
Brendan is preparing a general update to the Data Source editor logic and it should be easy to add this feature in this context. We are preparing everything on the interface side in 2.3, the programmatic changes are the next step planed after that, see #894.
This was just what I was looking for. Thanks Nils.
Can't wait for 2.3 with all this lovely functionality built into the data source builder!
Create an account or sign in to comment.
I’ve been using this quite often lately and this is certainly something that is useful for others:
Symphony offers a simple way to execute data source only if a required URL parameter is set. But from time to time you want to achieve the contrary and stop data source execution if a parameter is not set. With a small data source customization this is possible. Add this line to your
grab()
function replacingNameOfYourURLParam
with the parameter name that should be checked:Like so:
This will return an empty XML element if the parameter
title
is set.Finally change
allowEditorToParse()
to returnfalse
which will prevent the data source editor to edit your data source again and override your changes.