View Full Version : Data Grid in Custom Page
thezman
03-03-2013, 09:30 PM
I have created a customer page that works just fine. I used this process (https://vborg.vbsupport.ru/showthread.php?t=228112) to create the custom page. I can add some html to the template and it works like a charm.
What I need to do is add some PHP code to display a data grid. I have a data grid class that I can use in html pages to fetch and display data in a fancy grid control. Can I do this through the template system? I only want authenticated users to see the page and the data.
Any help is appreciated.
Lynne
03-03-2013, 09:38 PM
If you have php code to use, then it needs to be put in the php page. The templates only use html.
thezman
03-03-2013, 09:54 PM
Hmmmm.... I thought that was the case and out my code after $pagetitle = 'Grid Test'; and before $templater = vB_Template::create('GridTest'); with 'GridTest' being the name of my file and template. I get a blank page that lacks all the headers and footers from vbulletin.
When should I put my code?
--------------- Added 1362352177 at 1362352177 ---------------
OK, I have the grid rendering, but the navbar and vbulletin headers are rendering below the grid. That means I'm putting my customer code in correctly, but not in the right place.
Lynne
03-04-2013, 02:10 AM
I can't really help without seeing your code. But, I can tell you that you cannot use echo statements. You need to assign your output to a variable and output that variable into the template.
thezman
03-04-2013, 02:04 PM
I can't really help without seeing your code. But, I can tell you that you cannot use echo statements. You need to assign your output to a variable and output that variable into the template.
I suspected that was the case. I saw an article here on assigning a template to a variable to use in another template.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.