Mike Posted April 20, 2012 Share Posted April 20, 2012 Hi! I´m a new user of processwire and i have the next problem. When i include the sequence in my program i get an error: Error Call to undefined method Template::getTableData() I need help please Thanks! Link to comment Share on other sites More sharing options...
formmailer Posted April 20, 2012 Share Posted April 20, 2012 Hi Mike, Welcome to the forums. What are you trying to include and in what script are you trying to include it? Can you give a code example? /Jasper 1 Link to comment Share on other sites More sharing options...
Mike Posted April 23, 2012 Author Share Posted April 23, 2012 Thanks! but I have solved the problem. Now me a new problem to include the following lines: require_once("pw/index.php"); . . . $this->data['cms'] = $wire->pages->get("/about/what/"); My page says: The page you requested cannot be found! Surely I`ve missed some step. Thanks! Link to comment Share on other sites More sharing options...
ryan Posted April 23, 2012 Share Posted April 23, 2012 require_once("pw/index.php"); This may not be a safe inclusion because it's not specific enough. It's going to search all of PHP's paths for a "pw" dir before it searches the current dir. So be sure to complete that to a absolute or relative path. Absolute meaning a full "/path/to/pw/index.php" or relative meaning one that starts with a dot, i.e. "./pw/index.php" or "./index.php" or whatever it is relative to your PW installation. Also, for your API call, I suggest using wire('pages')->get() rather than $wire->pages->get(). Link to comment Share on other sites More sharing options...
Mike Posted April 24, 2012 Author Share Posted April 24, 2012 Thanks Ryan, but my most inmediate problem is another. I created a template and I created a page with this, but this does not show the fields. Why can this be? Thanks! Link to comment Share on other sites More sharing options...
ryan Posted April 24, 2012 Share Posted April 24, 2012 Mike can you give us a lot more detail? Are you creating a page in the admin or in the API? If in the API, is this from a template, a module or from a command line script? If you think screenshots would be helpful, please include that too. Link to comment Share on other sites More sharing options...
Mike Posted April 25, 2012 Author Share Posted April 25, 2012 Ok Ryan, my problem is that I have included this code in my phpprogram through a controller. <?php class ControllerCommonCMS extends Controller { public function index() { //includes the path that contains the variable require_once("pw/index.php"); //mypage contains the page $mypage = wire('pages')->get("/ourguarantee"); } } ?> I have to do to display the page? Thanks! Link to comment Share on other sites More sharing options...
ryan Posted April 25, 2012 Share Posted April 25, 2012 You can access any of the $pages fields like: $mypage->title. If you want to render the entire page and echo it to the user, you can do this: echo $mypage->render(); Link to comment Share on other sites More sharing options...
Mike Posted April 26, 2012 Author Share Posted April 26, 2012 Thank you very much Ryan! Now it has emerged the following problem: Error Uncaught exception 'WireException' with message 'Page /ccsMA/ourguarantee/ may not be rendered because outputFormatting is set to false But i have solved including: wire('pages')->setOutputFormatting(true); Now it show the fields but without the template format and images. Why can this be? Link to comment Share on other sites More sharing options...
ryan Posted April 26, 2012 Share Posted April 26, 2012 Now it show the fields but without the template format and images.Why can this be? I'm not sure I understand. Can you post a screenshot of the output that you get? Link to comment Share on other sites More sharing options...
Soma Posted April 26, 2012 Share Posted April 26, 2012 I would guess that you're assets css and images arent loading because you installed PW in a subdirectory. When you include PW into codeigniter controller the page render output the markup but the paths are screwed. You need to either install PW in the root same as application and system (in case of codeigniter) but that may create problems, or leave it in a subdirectory and somehow fix the paths with htaccess vodoo. I don't really know the answer and what would be best in this case. Link to comment Share on other sites More sharing options...
Mike Posted May 3, 2012 Author Share Posted May 3, 2012 Thank you very much for yours answers. I´ve found that to display the fields I have to include them in the template file. I have given the format I wanted and put the fields in this file, but i have a new question: if I do all this in the template file, what use is to resize the fields and their order in the template? Thanks!! Link to comment Share on other sites More sharing options...
ryan Posted May 3, 2012 Share Posted May 3, 2012 if I do all this in the template file, what use is to resize the fields and their order in the template? This is purely for controlling the presentation in the admin side. It really doesn't mean much on the front-end of your site, unless you iterate the $page object (in which case the fields will follow the same order). Link to comment Share on other sites More sharing options...
Mike Posted May 4, 2012 Author Share Posted May 4, 2012 Thank you for your attention and patience Ryan. I think I getting control ProcessWire 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