rooofl Posted March 3, 2014 Posted March 3, 2014 Hello, since a long time I am stuck on this probably stupid issue. I have two very similar fields: font keywords and font license. When I try to display the titles of the keywords, everything is just fine but for the titles of font licenses, things goes weird: // Keywords $keywords = $font->keywords; if ($keywords){ echo "<li><ul class='keywords'>"; echo "Keywords:"; foreach($keywords as $keyword){ echo "<li><a href='{$keyword->url}'>{$keyword->title}</a></li>"; // ok, the list of the keywords is displayed } echo "</ul></li>"; } // License $license = $font->license; if ($license){ echo "<li><ul class='license'>"; echo "License:"; echo "<li>{$license}</li>"; // displays the id of the matching license echo "<li>{$license->title}</li>"; // displays nothing echo "</ul></li>"; } I checked my license field and everything looks normal. Can you help me to find what is wrong ?
adrian Posted March 3, 2014 Posted March 3, 2014 Well assuming keywords and license are in the same format, have you tried foreach'ing through $license like you did with $keywords?
rooofl Posted March 3, 2014 Author Posted March 3, 2014 Well assuming keywords and license are in the same format, have you tried foreach'ing through $license like you did with $keywords? Awesome. You solved my problem, thank you. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now