By kae on
I've installed the cvs version of cck. It's working fairly well. How do I add "previous page", "next page" links? I have my posts in as book pages right now and will have to convert them over. How do I add "add a child page" and "add a sibling page" links? I searched on google and drupal.org. I did not even find anyone who asked this question.
Comments
37767
I've read 37767, 45050. below is how I tried to adapt it for cck
what i did
following instructions from node 45050
i put these 2 files in my fancy theme directory.
i put content in front of "test" since cck contents types seem to be actually of the syntax content-xxxx.
i made a new cck content type called test. it's on www.drupalecommerce.com
i put this in a file called content-test.tpl.php
i put this in a file called template.php
resulting error
this is the error that results. what does this mean?
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND n.status = 1 ORDER BY nid DESC' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN term_node t ON n.nid = t.nid INNER JOIN term_data r ON t.tid = r.tid WHERE n.type = 'content-test' AND n.nid < 103 AND r.tid = AND n.status = 1 ORDER BY nid DESC; in /home/myfof/public_html/drupalecommerce/includes/database.mysql.inc on line 120.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT name FROM term_data WHERE tid = ; in /home/public_html/includes/database.mysql.inc on line 120.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND n.status = 1 ORDER BY nid DESC' at line 1 query: SELECT n.nid, n.title FROM node n INNER JOIN term_node t ON n.nid = t.nid INNER JOIN term_data r ON t.tid = r.tid WHERE n.type = 'content-test' AND n.nid > 103 AND r.tid = AND n.status = 1 ORDER BY nid DESC; in /home/public_html/includes/database.mysql.inc on line 120.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT name FROM term_data WHERE tid = ; in /home/public_html/includes/database.mysql.inc on line 120.
views
possible clue. an issue related to views module and upgrading. see 51619. that person had a very similar error unrelated to cck or category.
(discovered the post by googling on "term_node" in 2nd line of funciton next_prev in the template.php I made)
disabled views. still the same error.
tid
i'm going through the code for the function next_prev. my best guess right now is that the empty tid is causing the program to crash. I checked, the test post, nid=112 has no tid and no row in table term_node.
2nd line from the code posted above
$query = db_query("SELECT tid FROM {term_node} WHERE nid = $current_nid;");
$tid = db_result($query);
any ideas on how to remedy this (and if this is indeed the problem) would be appreciated.
php snippet
56414 has a snippet for returning list of nodes. plan to check if it might help
54920 similar error. something about curly braces
tid
okay. i just established tid cannot be null. i put data in tid and the mysql data goes away. next--is there a better fix.
Keep Going!
Hi Kae - just a message that I am looking for the same functionality, and found your post. Thank you for documenting your progress so far. I'm about to try and replicate what you're up to...