eZ Community » Forums » Setup & design » Trouble on custom class visualization
expandshrink

Trouble on custom class visualization

Trouble on custom class visualization

Monday 05 December 2011 10:04:55 am - 12 replies

Hi everybody,

I write you because I find a problem and i don't know how to solve it. I've created a custom class (that I call "A"blunk.gif Emoticon and I've used for that class the folder Full View and a custom Line View. I'm working with EzP 4.3.0 and ezwebin.

Everything works good and the structure I've created is: FRONTPAGE -> FOLDER -> CLASS A.

When I try to go on CLASS A Full View everything seems it works but when in my template I try to search children it seems nothing has been found. Line View works correct too.

Obv. I think there's something wrong in my class A templates, but class A template is as same as folder one, so I think that nothing should be wrong. And Line View I've created works until it has to reach children node.

Have you got any idea where should it be the error? If you like I should post code of my two tpl files (I haven't it now but I should paste it later...).

However anyone knows where it should be available a good tutorial about custom templates?

Tnx a lot.

Bye
Paolo. 

Monday 05 December 2011 10:49:49 am

Hi,

Did you create a new template for your "A" class full view? I think showing your code would help more.

Jean-Luc.

Monday 05 December 2011 2:07:47 pm

Hi Jean-Luc,

damn me I forgot it and I've not that files here (I think I should post it later).

For class A I've created 2 new tpl files: 1 in Full Folder and 1 in Line Folder. The one in Line folder is completely customized by me and it works good, the one in Full Folder (the one I've copied and pasted from folder.tpl) not works. Probably the problem was there, but what I think is: why doesn't it see any children when I've a children in my content tree?

However, I've update you and all of you about my problem when I could catch class "A" full template.

Tnx a lot.
Paolo. 

Monday 05 December 2011 2:37:04 pm

Hi Paolo,

If you took the full folder template to use it for you class "A" full view, I think it won't work, as the folder class has a "container" attribute (checkbox). This attribute is the condition for showing or not the children nodes.

Monday 05 December 2011 4:36:17 pm

Hi Paolo,

did you set your "A" class to be the container in class edit interface? I think this is the reason why child items do not show on full view of your class.

EDIT: Damn, Jean-Luc was faster happy.gif Emoticon

Modified on Monday 05 December 2011 4:37:05 pm by Edi Modrić

Monday 05 December 2011 4:52:22 pm

Hi Paolo,

did you set your "A" class to be the container in class edit interface? I think this is the reason why child items do not show on full view of your class.

EDIT: Damn, Jean-Luc was faster happy.gif Emoticon

Two opinions are better than one!

Monday 05 December 2011 4:59:11 pm

Hi Paolo,

did you set your "A" class to be the container in class edit interface? I think this is the reason why child items do not show on full view of your class.

EDIT: Damn, Jean-Luc was faster happy.gif Emoticon

Two opinions are better than one!

Exactly!

Monday 05 December 2011 10:43:19 pm

Hi Paolo,

did you set your "A" class to be the container in class edit interface? I think this is the reason why child items do not show on full view of your class.

EDIT: Damn, Jean-Luc was faster happy.gif Emoticon

Hi Jean Luc and Hi Edi,

I've checked and I've set my class as a container. But it seems that it doesn't work (it has been already set before your suggest happy.gif Emoticon ).

I'm going to post you my Class "A" full tpl asap.

Bye and Tnx a lot.

Paolo

Monday 05 December 2011 10:49:41 pm

That's my Class A Full View template...

 {* Organizzazione - Full view *}
{def $rss_export = fetch( 'rss', 'export_by_node', hash( 'node_id', $node.node_id ) )}
 
<div class="border-box">
<div class="border-tl"><div class="border-tr"><div class="border-tc"></div></div></div>
<div class="border-ml"><div class="border-mr"><div class="border-mc float-break">
 
<div class="content-view-full">
    <div class="class-folder">
            
        {if $rss_export}
        <div class="attribute-rss-icon">
            <a href="{concat( '/rss/feed/', $rss_export.access_url )|ezurl( 'no' )}" title="{$rss_export.title|wash()}"><img src="{'rss-icon.gif'|ezimage( 'no' )}" alt="{$rss_export.title|wash()}" /></a>
        </div>
        {/if}
        
        <!-- IT WORKS -->
        <div class="attribute-header">
            <h1>{attribute_view_gui attribute=$node.data_map.departement} - 
            {attribute_view_gui attribute=$node.data_map.office}</h1>
        </div>
        <!-- SEEMS NOT WORKS -->
       {if $node.object.data_map.show_children.data_int}
            {def $page_limit = 10
                 $classes = ezini( 'MenuContentSettings', 'ExtraIdentifierList', 'menu.ini' )
                 $children = array()
                 $children_count = ''}
                 
            {if le( $node.depth, '3')}
                {set $classes = $classes|merge( ezini( 'ChildrenNodeList', 'ExcludedClasses', 'content.ini' ) )}
            {/if}
 
            {set $children_count=fetch_alias( 'children_count', hash( 'parent_node_id', $node.node_id,
                                                                      'class_filter_type', 'exclude',
                                                                      'class_filter_array', $classes ) )}
 
            <div class="content-view-children">
                {if $children_count}
                    {foreach fetch_alias( 'children', hash( 'parent_node_id', $node.node_id,
                                                            'offset', $view_parameters.offset,
                                                            'sort_by', $node.sort_array,
                                                            'class_filter_type', 'exclude',
                                                            'class_filter_array', $classes,
                                                            'limit', $page_limit ) ) as $child }
                        {node_view_gui view='line' content_node=$child}
                    {/foreach}
                {/if}
            </div>
 
            {include name=navigator
                     uri='design:navigator/google.tpl'
                     page_uri=$node.url_alias
                     item_count=$children_count
                     view_parameters=$view_parameters
                     item_limit=$page_limit}
 
       {/if}
    </div>
</div>
 
</div></div></div>
<div class="border-bl"><div class="border-br"><div class="border-bc"></div></div></div>
</div>

That's similar in 90% to folder one at least of 5-6 lines removed (has_content condition for example...).

Modified on Monday 05 December 2011 11:19:50 pm by Paolo Riva

Monday 05 December 2011 11:40:00 pm

By using Debug Mode on my EzP I found this error:

 <table><tr><td class="debugheader"><strong><span style="color: red;">Error:</span> eZTemplate:eZTemplateCompiler</strong></td><td class="debugheader">Dec 05 2011 23:37:45</td></tr><tr><td colspan="2">
 
PHP variable $if_cond['show_children'] does not exist, cannot fetch the value.

Monday 05 December 2011 11:52:16 pm

RESOLVED!

Tnx to your suggest and tnx to Debug output option of EzP I found the solution.
I forgot to insert in my custom class the "show_children" field. So EzP was unable to fetch the children under my Class "A".

Really tnx a lot for your support Edi and Jean, if you need more screenshot about my solution (as information for further support or tutorial) just let me know.

Bye and for another time...tnx a lot.

Paolo.

Modified on Monday 05 December 2011 11:52:33 pm by Paolo Riva

Tuesday 06 December 2011 9:35:06 am

Hi Paolo,

Nice that you found out about the show_children field. If you are re-using the folder full view template, be careful to match all folder attributes with the attributes of your custom class.

Tuesday 06 December 2011 10:24:17 am

Good to see you resolved it Paolo!

Have a great day! happy.gif Emoticon

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from