This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hey,
i have a problem. i am trying to make a loop for show this information on my frontpage. I have records more than one. I tried to make a loop for that but it doesnt work for twig or i just cant find the true way. Any one help me?
Thanks
Hey,
In you link is no twig syntax is normal php. I twig you can build a loop like this
{% for user in users %}
<li>{{ user.username }}</li>
{% endfor %}
Please do a die and dump in your PHP Code an see if there any objects fetched from database. Also you have to pass your object to the page.
$this->page
When i am doing this. My page working. But my records are more than one. So i need a loop for this. But i cant do it with twig. My database is working .
I use your twig code but it doesnt show anything on my page.
I find a way to make this. I use builder plugin. I just have a problem about it.
{%if record.uyeid == {{ sessionuye }} %}
{% endif %}
{{sessionuye }} isnt work.
Last updated
Why you can't do it with twig? Your code is also twig code. Can you post your code?
Last updated
Oh i missed your message sorry. I am sharing my all code. At my code part $this['takipci'] is overwriting. I dont want it. I need it turn a array and i wanna use that array in my frontpage in my if conditions.
Code Part http://kopy.io/ynKNf
Front Part
Now this if condition just work for last record. Cause overwriting. I make it a loop. I am working on this like 5 days. I cant find a way :(
Thanks Crazymodder
You are currently echoing a twig variable within your Twig if statement - instead, just try
{% if record.uyeid == sessionuye %}
• {{ attribute(record, displayColumn) }}
{% endif %}
no need for the {{ }}
wrapped around sessionuye
Last updated
1-8 of 8