Forums / Setup & design / How to make Demo find my own News?

How to make Demo find my own News?

Author Message

Scot Wilcoxon

Monday 21 April 2003 11:14:41 pm

I'm learning how Demo works by using the Demo pagelayout on a non-Demo site. So I have the standard database loaded, but not the Demo DB items.

My first test, how News articles behave, isn't behaving. Nothing shows on the home page in the News box. Recent headlines are supposed to appear.

I've tried the node ID of my News folder, and of a News article. Nothing appears. When I put text in the News box, it appears. When I put text within the loop=$news_list, nothing appears, which is what I'd expect when nothing is retrieved.

news_list=fetch(content,list,hash(parent_node_id,16,limit,5,sort_by,array(published,false()),class_filter_type,include,class_filter_array,array(2)))}

I also tried a stripped-down version. It's hard to tinker with anything when documentation for content, list, and hash() can't be found.

news_list=fetch(content,list,hash(parent_node_id,16))}

The error_log is still showing:

/usr/src/redhat/BUILD/php-4.3.1/Zend/zend_builtin_functions.c(901) : Freeing 0x08B481D4 (20 bytes), script=/var/www/html/ezpublish-3.0-1/index.php
/usr/src/redhat/BUILD/php-4.3.1/Zend/zend_variables.c(111) : Actual location (location was relayed)
/usr/src/redhat/BUILD/php-4.3.1/Zend/zend_builtin_functions.c(892) : Freeing 0x08B60724 (12 bytes), script=/var/www/html/ezpublish-3.0-1/index.php
/usr/src/redhat/BUILD/php-4.3.1/Zend/zend_builtin_functions.c(892) : Freeing 0x0884DA34 (12 bytes), script=/var/www/html/ezpublish-3.0-1/index.php
/usr/src/redhat/BUILD/php-4.3.1/Zend/zend_builtin_functions.c(901) : Freeing 0x08E3EB2C (20 bytes), script=/var/www/html/ezpublish-3.0-1/index.php
/usr/src/redhat/BUILD/php-4.3.1/Zend/zend_variables.c(111) : Actual location (location was relayed)

With Debug, I am seeing the following (image files not copied to my test area, so they should be missing):

eZ debug
Timing: Apr 22 2003 00:58:29

Script start

Timing: Apr 22 2003 00:58:29

Module start 'content'

Warning: eZModuleOperationInfo::execute Apr 22 2003 00:58:29

Missing main operation memento for key: 53fca9c2dd3ec47c71f7d6b2311a92b9

Warning: PHP Apr 22 2003 00:58:29

Undefined offset: 0 in /var/www/html/ezpublish-3.0-1/kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php on line 157

Timing: Apr 22 2003 00:58:29

Module end 'content'

Warning: eZTemplate:ezimage Apr 22 2003 00:58:29

Image 'topmenu.gif' does not exist in any design

Warning: eZTemplate:ezimage Apr 22 2003 00:58:29

Image 'mycompanylogo.jpg' does not exist in any design

Warning: eZTemplate:ezimage Apr 22 2003 00:58:29

Image 'search.gif' does not exist in any design

Warning: eZTemplate:ezimage Apr 22 2003 00:58:29

Image 'speed.jpg' does not exist in any design

Timing: Apr 22 2003 00:58:29

End

Sergiy Pushchin

Wednesday 23 April 2003 12:16:22 am

>news_list=fetch(content,list,hash(parent_node_id,16,limit,5,sort_by,array(published,false()),class_filter_type,include,class_filter_array,array(2)))}
Are you sure that 16 here is the node_id of Your news folder? It can be objectID.

Scot Wilcoxon

Thursday 24 April 2003 8:03:41 am

16 is in the "id" field of "News" in table ezcontentobject. That must be the object ID.

I think the node ID is 160, as table eznode_assignment has an ID of 160 in the "id" field of the row with "contentobject_id" of 16.

16 find nothing.
160 ... well, finds one thing with item.name="Root folder" and item.node_id=2. But only when I strip off all the parameters other than "parent_node_id,160".

I thought "parent_node_id,160" searched for items with 160 as the parent, not searching for the item which is the parent of node 160. (not that it's documented anyplace but examples)

Sergiy Pushchin

Thursday 24 April 2003 9:26:35 am

16 is node id from ezcontentobject_tree table, it is a node where your news object published. To know this number you can look to the url when you view News folder in admin interface (last number in url).

Scot Wilcoxon

Thursday 24 April 2003 2:58:40 pm

Ah, yes. Objectid 16 happens to be nodeid 17, with path_identification_string "news". Nothing retrieved, even by the simpler
news_list=fetch(content,list,hash(parent_node_id,17))}
{section name=News5 loop=$news_list}
{$News5:item.name}<br />
{$News5:item.node_id}<br />
{/section}

Scot Wilcoxon

Monday 12 May 2003 11:18:37 pm

Demo's code still can't find my News folder.
Is "News" supposed to be a folder?

The fetch() for items with parent of the News folder doesn't seem to produce anything which a {section} loop can process. Merely printing the variable with the results of the fetch() just says "Array", but I can't find an incantation to display the contents.

The News folder is being displayed by the {section name=Menu} code, which somehow finds it in a way which can be processed.

This is with a database which has no Demo data. I created the News folder from admin, but can't persuade the Demo code to look at its contents.