so far, I didn’t find a hint or description how to use @joeworkman 's AGENT IF sub stack which is part of the Agent stack.
Does anybody uses this? And if yes, for what purpose?
I want to publish certain content based on content in another stack (IF condition A is true, show B, ELSE show nothing f.e.). I thought Agent might be able to do that, but I’m not sure.
Thanks - I know that, but that’s the usual function of the Agent stack. But what about the AGENT IF sub stack? This demands a PHP condition (e.g. $username == “username”). It’s not clear (for me) how to use it or where to put the condition
The IF stack is not a “publishing” stack, it makes his decisions on runtime, e.g. when the page is loaded. The if conditions are PHP conditions, so e.g. you can check if a URL parameter is set, a session variable or any other you can think of.
Perhaps you can describe a bit more in detail, what you want to archive?
It uses IF conditions in various places, for example:
If the page is first visited, the header is large and products of the week are displayed
If the page is displayed from a category search or from changing the page (browsing products), the header is smaller, the products of the weeks are hidden and also the heading changes to the category
If a parameter display is set, it changes the view between tiled and list view
If you do a search, the heading shows a heading “We found x products of {searchterm}”, otherwise it’s hidden.
This makes sense… useful for a number of purposes. However, not 100% what I was looking for.
Meanwhile, I’ve chosen to use @willwood 's WebYep Boolean stack allowing to display or hide almost any content stack without opening RW. It still needs some manual work but done quickly.
My purpose: I want to hide a calendar list view pulled from a Google calendar if no events are taking place. Otherwise, a list of all events are shown.
I don’t use a stack for the Google calendar. The one(s) that exist are either somewhat clumsy or development had been stopped… a pity.
I use a Google calendar script (http://www.kacurak.com/formatgooglecalendar/example.html) which I modified to my needs. It creates a simple event list, sufficient for the purposes I need. There are other scripts around so far I saw, but I did not use them yet.
So the Agent if stack requires that you are familiar with PHP code. It allows you to build logic based on PHP variables that you or some software has created on the page. Agent started as a server visibility stack but it’s really turned into a Swiss army knife of server side utilities. But the core is still mostly about showing and hiding data at the server level.
Just a random thought: you can also use Google docs / sheets for configuring websites / content of websites.
Just an example, this little order site uses Google sheets for displaying the food menu (via LiveData Stack) and a custom condition stack to hide the order form once the configured maximum number of orders has come in:
True, that’s an option - as well as GSheet from Weavium which has an IF option, too. However, the client needs to have / accept having a Google account
I have to put my 2¢ on website content on Google sheets. This is such a horrible idea! This makes me cringe every time I see someone doing it. You do not want to rely on any web service to be up in order to supply critical data for your site content to work. This is especially true with Google. It’s not a matter of “if” but “when” this will break your website.
You also have to think about performance and SEO implications of this as well.