Forums / Setup & design / Custom class problem

Custom class problem

Author Message

John Mina

Sunday 14 March 2004 2:16:45 am

Dear ALL,
first , please take a moment to read and help if u can. Please.

I want to created a new class for a daily word that would be fetched and published aoutomatically based on the date.
The custom class i created included date field, and a text field. not an XML field.
I created a section for that class.
I added 2 daily words in a folder that is assigned to the section i created.

in the front page i will show these fetched words. so i wrote direcly in the front_folder.tpl the following code:-

{let children=fetch(content,list,hash('parent_node_id',$n.node_id)) ch_count=fetch(content,list_count,hash('parent_node_id',$n.node_id)) }
{$ch_count}
{section var=child loop=$children}
{$child.item.name}
{/section}
{/let}

the problem that the always, the $ch_count is 0 while i ahve children in this folder, i am sure of that, and when i change the parent node id i can c that everythign is normal
and so it never enters the section to print out anything as it see nothing.:(

as amatter of fact i thought it may be a matter of anonymous user's roles problem, so enabled the anonymous user to read that section whereever it is in the contect
"content read Section( word ) "

I do appriciate your help. even if u have no answer for this please le tm eknow that my voice reached you please write me anything.
This matter had been bothering me since last week and i don't know how to proceed working i need that alot in my project so please try to help me if any suggestions
Sincerely John

Alex Jones

Monday 15 March 2004 6:22:30 am

John, a couple of quick questions:

1. What is $n? Has that been set previously? Are you able to view its contents?

2. Does an actual 0 show up for <i>{$ch_count}</i>, or is it empty? You may need to loop <i>$ch_count</i> to get past 0.

There may be other ways to achieve your goals. Will words be re-used after a certain period of time (day, week, month or a year?)

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

John Mina

Tuesday 16 March 2004 1:11:44 am

First,Thanks A lot Alex for trying to help

$n is a node that is a father to all words that should be added, in other words, the folder that is containing all the "words"'s objects.

and the ch_count shows the number of children if available. only the children that he counts is that articles/ info pages/other fodler/or any built in class. but when it has only children from that custom class it counts ZERO, and also it doesn't go into any loop on the fetched record set.

Waiting your comment

Alex Jones

Tuesday 16 March 2004 6:27:52 am

Hrrrrm.... Did you also ensure the Anonymous role can read the custom class (in addition to the custom section)? What version of eZ are you running?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

John Mina

Wednesday 17 March 2004 12:05:44 am

Well yes,
i ensured that the anonymous user can view the section and the object, btoh together.
Regarding the version i forgot the version numebr i have? how would i get that to you?

what do u think ?
could it have anythign to do with the override.ini.append
sincerely

Alex Jones

Wednesday 17 March 2004 7:32:50 am

Hrrrm, I'm not sure what it could be to be honest. Sorry. I doubt that the override.ini.append could be the problem. Perhaps someone else can chime in and point out what we are missing.

To find your version number, go to the <i>Setup</i> section and view the <i>System Information</i>.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

John Mina

Thursday 18 March 2004 2:52:46 am

Thanks ALex, i do appriciate your help
or at least your try to help me
about the version number it is "3.3-3 (3.3)"
Thanks for that tip

Alex, do you have idea about the field of the online editor, to enrich the editing tool for articles/info pages...etc

BEst regards,
John

Alex Jones

Thursday 18 March 2004 7:18:46 am

Sorry, we don't use the Online Editor, so I do not know of that field.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

John Mina

Saturday 20 March 2004 11:56:18 pm

HEy helloooo
I got it working now
and i guess i knew the problem where it was?

After assigning the role of reading the section by the anonymous user, you have , again you have , or we have :) to CLICK THE STORE button,

i foound it as when i went to the page of viewing roles i didn't find the rold that i added last time i got in here, which enables the anonymous user to view the children of this section. and when i asked to edit the roles i foudn the ROLE there. so i clicked STORE button ,as i said, and directly i found it there in the ASsigned roles, alsoi foudn the EzPublish template that is counting the custom class children, counted them instead of just showing ZERO "0"

BEST Regards
JOhn

Alex Jones

Monday 22 March 2004 7:01:07 am

Glad to hear you figured it out! Sometimes it is the simplest things that prove the most annoying.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>