Forum
Variables not passed into Templates 2.8.2
Drew, I have been at this for hours and absolutely variables are not being passed into templates.
PerchSystem::get_vars()
shows the variables which are populated through routes
Array ( [url_0] => /catalog/200 [url_catID] => 200 [url_1] => 200 [perch_page_path] => /catalog [lang] => en )
and
perch_get('catID') // outputs 200
works a charm... but the variables are not coming into templates...
heres the perch:showall
ID Value
perch_page_path /perch/core/apps/content/edit/index.php
_id 4
text test
_title test
itemRowID 28
itemID 4
regionID 15
pageID 7
itemRev 2
itemOrder 1000
itemJSON {"_id":"4","text":"test","_title":"test"}
itemSearch test
itemUpdated 2015-03-03 21:40:14
itemUpdatedBy 1
perch_item_first true
perch_item_last true
perch_item_zero_index 0
perch_item_index 1
perch_item_rev_index 1
perch_item_rev_zero_index 0
perch_item_odd
perch_item_count 1
I have been using perch_content_custom()
It's certainly working in my tests here, Robert. Can you give a more concrete example?
All Files: https://github.com/robertketter/perch_template_var_test.git
Template: Standard out of box article.html
Page: template_var_test.php
Perch 2.8.2 Output
As you can see, The variables are there...
but the variables are not passed in... then finally at the end of the page you see the output of get_vars() (just above debug output) and all the variables are still there.
Somehow this has worked its way down to 3rd page. Hoping it doesn't get buried and forgotten. :)
Not forgotten, just needs deeper delving into, as it's all working for me at the moment.
Drew, Could you please provide me a simple page (template) that is working on your system, that I can plug into mine and see if it works here.
I must be doing something wrong somewhere cause in the past I have had this working, but now I don't seem to have it working on development server (perch or runway) or working in my real world server.
I know your busy and I take value in any time you have to help me and the many others.
Thanks man,
Robert
Here's what I'm using:
And my
vars.html
template is:Drew, I could totally shoot myself right about now... The problem was so simple and your code made it VERY clear...
I had forgotten the array() in my perch_content_custom()
mine:
yours:
my original code is working flawlessly now... with the missing second argument in place...
Thanks so much...
No problem - a simple mistake is the best outcome as far as I'm concerned! :)