Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

multiple calls of PHx don't work in 1.2.1 #1263

Closed
Tourist4Life opened this issue Mar 1, 2017 · 5 comments
Closed

multiple calls of PHx don't work in 1.2.1 #1263

Tourist4Life opened this issue Mar 1, 2017 · 5 comments

Comments

@Tourist4Life
Copy link

Seems that one PHx call is fine but if I put more than one in a TPL the second doesn't work. I'd love to use something besides phx to check to see if an TV is empty or not in Evo but I'm not sure anything else exists?

@Tourist4Life
Copy link
Author

I found this code:

[*Photo2:is=``:else=``*]

which works....but still a bit concerned that multiple instances of PHx on one page fail.

@nick0
Copy link

nick0 commented Mar 1, 2017

This doesn't solve the multiple phx call issue you have found but as a workaround you could try using the IF snippet for the second call.

Something like this, just fill in the blanks...
[[if? &is=`[*Photo2*]:empty` &then=`` &else=`CHANGETHIS`]]

Or if not empty...
[[if? &is=`[*Photo2*]:!empty` &then=`CHANGETHIS`]]

@MrSwed
Copy link
Contributor

MrSwed commented Mar 2, 2017

in different situations needs different call phx, for example it may be
[*Photo2:is=``:else=``*]
for ditto chunk:
[+Photo2:is=``:else=``+]
and most reliable:

[*phx:input=`[*Photo2*]`:is=``:else=``*]
[+phx:input=`[*Photo2*]`:is=``:else=``+]

please, give yours full code of using multi phx,

PS. example usage

@Tourist4Life
Copy link
Author

Tourist4Life commented Mar 2, 2017

Here is the code that I'm using that works (without two instances of PHx):

ul class="amenities">
								[+phx:if=`[*propertytype*]`:is=`Land`:then=`<li><i class="icon-land"></i> Land / Lot</li>`:else=`[+phx:if=`[*propertytype*]`:is=`Residential`:then=`<li><i class="icon-house"></i> Residential</li>`:else=`<li><i class="icon-apartment"></i> Apartment / Condo / Townhome</li>`+]
								`+]
								
								<li><i class="icon-area"></i> [*listing_floor_area*] Sq Ft</li>
								<li><i class="icon-bedrooms"></i> [*listing_bedrooms*]</li>
								<li><i class="icon-bathrooms"></i> [*listing_bathrooms*]</li>
							</ul>
							
							<div id="property-id">MLS: #[*listing_mls*]</div>
						</div>

						<!-- BEGIN PROPERTY DETAIL SLIDERS WRAPPER -->
						<div id="property-detail-wrapper" class="style1">
							
							<div class="price">
								<i class="fa fa-home"></i>For Sale
								<span>$[*listing_price*]</span>
							</div>
									
							<!-- BEGIN PROPERTY DETAIL LARGE IMAGE SLIDER -->
							<div id="property-detail-large" class="owl-carousel">
								
								[*Photo1:is=``:else=`
								<div class="item">
									<img src="[*Photo1*]" alt="Photo1:  [*pagetitle*] for sale in [*neighborhood*]" />
								</div>`*]
```
								`

If I replace the `[*Photo1:is=``:else=`` with phx it fails.

@MrSwed
Copy link
Contributor

MrSwed commented Mar 2, 2017

try

[+phx:if=`[*Photo1*]`:is=``:else=`
								<div class="item">
									<img src="[*Photo1*]" alt="Photo1:  [*pagetitle*] for sale in [*neighborhood*]" />
								</div>`+]

or (ifnotempty or isnotempty)

[+phx:if=`[*Photo1*]`:ifnotempty=`
								<div class="item">
									<img src="[*Photo1*]" alt="Photo1:  [*pagetitle*] for sale in [*neighborhood*]" />
								</div>`+]

@Dmi3yy Dmi3yy closed this as completed Jul 15, 2017
Dmi3yy added a commit that referenced this issue Nov 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants