You need to sign in to do that
Don't have an account?
Conditionally display apex tags?
Hi,
I'm a bit new to Visualforce development, but I'm hoping someone can provide the syntax necessary to do what I want here.
I have this Visualforce page and I want to conditionally display certain apex tags in the page based a value in the query string.
Here is my code. If the value "city" is in the query string I want to show the block of code in "Code B" below otherwise show the block of code in 'Code A". Basically one block of code is wrapped with a site template and the other is not.
What would the code need to look like to achive this based on a URL/Query String parameter
<!-- Code A -->
<apex:page controller="MyCustomController" sidebar="false" showheader="false">
<apex:define name="body">
<apex:form>
</apex:form>
</apex:define>
</apex:page>
<!-- Code B -->
<apex:page controller="MyCustomController" sidebar="false" showheader="false">
<apex:composition template="{!$Site.Template}">
<apex:define name="body">
<apex:form>
</apex:form>
</apex:define>
</apex:composition>
</apex:page>
Thanks and any help appreciated.
Hi,
You may use the rendered tag as follows.
The boolean variable isCity need to be defined in MyCustomController :