rooofl Posted March 3, 2014 Share 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 ? Link to comment Share on other sites More sharing options...
adrian Posted March 3, 2014 Share 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? Link to comment Share on other sites More sharing options...
rooofl Posted March 3, 2014 Author Share 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 Link to comment Share on other sites More sharing options...
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