How To Use ACF Fields In Conjunction With Dynamic Content & Rendering Logic
There are many ways in which you could use ACF fields in conjunction with Dynamic Content & Rendering Logic in Avada. It’s best to illustrate with an example.
Imagine we have a website owner who has a portfolio, and on just some portfolio posts, he wants to provide a downloadable project summary, in the form of a pdf file downloaded from a button. Let’s walk throught he steps he would take with ACF Pro and Avada to accomplish this.
Our website owner first creates a new Field Group In ACF Pro. He gives it a label of Portfolio PDF, and a name of portfolio_pdf. The type is a url field.
In the Rule field, under Location, he chooses “Post Type is equal to Portfolio”, which will set the rule that the Field Group will display on Portolio posts. This means this Custom Field Group will display on Portfolio posts, but nowhere else.
On the portfolio posts he wants to display the button link to the pdf, he edits those posts, and looks for the ACF Pro Portfolio PDF field. Here, he enters the path to the uploaded PDF for the individual project. On the other portfolio posts, he just leaves this field empty.
On his Portfolio Content Layout Section, he adds a new full width Column containing a Button Element. In the Button URL field he clicks on the Dynamic Content icon, and adds Advanced Custom Fields > ACF Link. In the Field name, he adds the name of the ACF field, in this case portfolio_pdf., and for the Button Text adds Download Brief PDF.
Then on the Column, he goes to the Extras tab and add some Rendering Logic. This is what controls whether or not the button displays. For the Condition Type, he chooses ACF Field, adds the field name of portfolio_pdf and specifies that for this column to render, the ACF Field called portfolio_pdf must contain the text .pdf (this will always be in the file path).
On the Portfolio posts where he does this, the button will appear, linked to the pdf specified in the Portfolio PDF field in ACF. On the posts where that field is empty, the Container rendering logic will prohibit that container from being displayed.
See below for the portfolio post that displays the button, and below that for one which does not.