right sidebar context infos dependent. How to ?

Author Message

laurent le cadet

Monday 11 April 2005 9:20:14 am

Hi,

I'm still searching for a nice way to display contextuels infos on the right hand of the pagelayout.

I imaging to add a xml text field to the folder content class which could be "context".

The right hand menu could display the "context" content for each children of this folder.

Is that a good starting point or totaly stupid ?

Maybe the best way is to create a context.tpl that we can add via admin toolbar management.

What could be the code for the template ?

Laurent.

Ekkehard Dörre

Monday 11 April 2005 10:38:11 am

I do it another way:

Folder,

in the middle: fetch all classes without right row,
folder.tpl with

class_filter_type, exclude,
class_filter_array, array( 'folder','right_row'
)

right: fetch new class right row in pagelayout.tpl. That's it.

class_filter_type, include,
class_filter_array, array( 'right_row' ) ) ) )}

Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Ekkehard Dörre

Monday 11 April 2005 10:46:50 am

And you can use another class for metatags and titletags:
http://ez.no/community/forum/developer/meta_description_tag

Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Xavier Dutoit

Tuesday 12 April 2005 12:51:22 am

What I do in this case it to create "context" objects elsewhere and "link" them (as related objects).

I then fetch the related objects on the right hand column (and usualy display them with a custom 'side' view).

Here, the benefit is to be able to link existing objects (products, articles)...

http://www.sydesy.com

Xavier Dutoit

Tuesday 12 April 2005 12:58:11 am

I have a somewhat related problem. If one of you has an idea:
http://ez.no/community/forum/developer/how_to_exchange_parameters_between_several_parts_blocks_on_a_page

The problem you might experience is the cache if I'm right: all the variables are only set in the main content template when it's compiled (the first time), no variables are set anymore afterward.

http://www.sydesy.com

Ekkehard Dörre

Tuesday 12 April 2005 1:16:35 am

In my case cache is not a problem.

You think about something like the latest news box?
3.5:
Than try to insert in your xmltext in article an object (folder) with articles inside, align="right" and embed. That's it.

Hope I understand you well.

Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Xavier Dutoit

Tuesday 12 April 2005 1:29:30 am

Hi,

No with that code on the right hand column :

{let related_objects=$node.object.related_contentobject_array}
<div class='related'>
      {section name=ContentObject  loop=$related_objects show=$related_objects}
        <div class="item">
        {content_view_gui view=side (or embed or line...) content_object=$:item size=small}
        </div>
      {/section}
    {/let}

Here, you list all the related objects on the right hand column.

X+

http://www.sydesy.com

laurent le cadet

Tuesday 12 April 2005 3:39:48 am

Hi again.

Ekke,

I've tryed what you said.

resume :

- create a new class "infos"
- exclude from the full/folder.tpl fetch
- insert in pagelayout.tpl

{let children=fetch
('content',list,hash(parent_node_id,$node.node_id,
class_filter_type, include,
class_filter_array, array( 'infos' )))}
{section name=Child loop=$children}
{node_view_gui view=full content_node=$Child:item}
{/section}
{/let}

This sounds great...BUT ;)...I have to clear the cache each time I want to see "infos" on the right side.

I also tryed with adding an infos.tpl via admin/toolbar but the result is the same...clear cache.

Any hints ?

Laurent.

laurent le cadet

Tuesday 12 April 2005 8:55:09 am

I tryed to change a little bit my template :

{let context=fetch( content, list, hash( parent_node_id, $node.node_id,
class_filter_type, include,
class_filter_array, array( 'infos' ) ) ) }
{section var=infos loop=$context}
{node_view_gui view=full content_node=$infos}
{/section}
{/let}

but I still have a cache problem.

I can print out the content after clearing the cache but just one time.
If I come back to the node again, there is no more content (??)

Laurent.

Ekkehard Dörre

Tuesday 12 April 2005 10:02:27 am

Try this:

{section name=Child loop=fetch(content, list, hash(
parent_node_id, $DesignKeys:used.node,
class_filter_type, include,
class_filter_array, array( 'infos' ) ) )}

{node_view_gui view=full content_node=$Child:item}

{/section}

More infos, it might help Xavier:
http://ez.no/ez_publish/documentation/customization/custom_design/template_variables_set_by_ezpublish
http://www.ez.no/community/forum/setup_design/node_node_id_doesn_t_work_in_ez_publish_3_4

Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

laurent le cadet

Tuesday 12 April 2005 10:46:47 am

Ekke,

Still some strange behavior with the cache but it seems to do the trick...CHAMPAGNE ! ;)

Thanks a lot.

Laurent.

Ekkehard Dörre

Tuesday 12 April 2005 3:58:31 pm

CHAMPAGNE? OK at the next camp, but in Norway it isn't expensive, it is liquid gold! So a beer is better ;-)

Here is the old tread March 2003:

http://ez.no/community/forum/setup_design/left_menu_with_viewcachingtrue
http://ez.no/community/bugs/always_have_a_valid_node_object_available

I think you'll soon find this useful:

How to find the parent and grandparent of an object
http://ez.no/ez_publish/documentation/incoming/how_to_find_the_parent_and_grandparent_of_an_object

Greetings,
ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

laurent le cadet

Tuesday 12 April 2005 11:34:36 pm

I'm not sure I'll be there but I promise I'll bring my own bottle...just in case.

Laurent.

laurent le cadet

Wednesday 13 April 2005 10:16:37 am

Hi again,

As I learned a lot above, I started a right bar tool factorie ;).

I have 2 template that are available as tool in admin :

actu_list.tpl

<div class="toollist">
<div class="toollist-design">
<h2>Derni&egrave;res publications</h2>
<div class="content-view-children">
{switch match=$module_result.section_id}
  {case match=6}
     {let dernieres=fetch( content, tree, hash(
parent_node_id, 92, limit, 2,
class_filter_type, exclude,
class_filter_array, array( 'folder' ) ) ) }
	 {section var=child loop=$dernieres}
         {node_view_gui view=listitem content_node=$child}
    {/section}
	{/let} 
  {/case}	  
  {case match=7}
     {let dernieres=fetch( content, tree, hash( parent_node_id, 93, limit, 2, class_filter_type, exclude,
class_filter_array, array( 'folder' ) ) ) }
section var=child loop=$dernieres}
         {node_view_gui view=listitem content_node=$child}
    {/section}
	{/let}  
  {/case}
{/switch}
</div>
</div>
</div>

infos.tpl

{section name=Enfants loop=fetch(content, list, hash(
parent_node_id, $DesignKeys:used.node,
class_filter_type, include,
class_filter_array, array( 'infos' ) ) )}
{node_view_gui view=full content_node=$Enfants:item}
{/section}

If I put infos.tpl before actu_list.tpl, infos.tpl doesn't appear.

In the other way it's ok.

I was talking about strange cache behavior, but it's not cache.
I tryed to change in every manner but I have no solution.

It's a little bit out of this thread but if someone can explain me what's wrong, he will be welcome.

Laurent.

Ekkehard Dörre

Wednesday 13 April 2005 11:31:46 am

Laurent wrote:
<i>If I put infos.tpl before actu_list.tpl, infos.tpl doesn't appear.</i>

Can's see why, look into the xhtml sourcecode, if it is there. Perhaps one div is behind the other.

There is an error in actu_list.tpl

{let dernieres=fetch( content, tree, hash( parent_node_id, 93, limit, 2, class_filter_type, exclude,
class_filter_array, array( 'folder' ) ) ) }
section var=child loop=$dernieres}
         {node_view_gui view=listitem content_node=$child}
    {/section}
	{/let}  

should be

{let dernieres=fetch( content, tree, hash( parent_node_id, 93, limit, 2, class_filter_type, exclude,
class_filter_array, array( 'folder' ) ) ) }
{section var=child loop=$dernieres}
         {node_view_gui view=listitem content_node=$child}
    {/section}
	{/let}  

instead of $module_result.section_id you can use
$DesignKeys:used.section
Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Ekkehard Dörre

Wednesday 13 April 2005 11:37:33 am

... and i made a new sitemap for me with latest published objects and latest modified objects:
http://ez.no/community/forum/setup_design/understanding_fetch

Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

laurent le cadet

Wednesday 13 April 2005 11:40:01 pm

for the missing "{", it was a copy/paste error. No prob.

My problem, infos.tpl VS actu_list.tpl, is not solved. I made a single test template compiling both actu and infos fetch but it's exactly the same result. 1st or 2nd position for infos make them appear or not.

...

Ekkehard Dörre

Thursday 14 April 2005 1:28:08 am

Try this (not testet only written here)

{let dernieres=fetch( content, tree, hash( parent_node_id, 93, limit, 2, class_filter_type, exclude,
class_filter_array, array( 'folder' ) ) ) }
{section var=infos loop=$dernieres}
         {node_view_gui view=listitem content_node=$infos:item}
    {/section}
	{/let}  

What is the differenze between section var=infos
and section name=infos ?
Found it:
http://www.ez.no/ez_publish/documentation/reference/template_functions/program_flow/section
Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Ekkehard Dörre

Thursday 14 April 2005 1:34:27 am

and change

{section name=Enfants loop=fetch(content, list, hash(
parent_node_id, $DesignKeys:used.node,
class_filter_type, include,
class_filter_array, array( 'infos' ) ) )}
{node_view_gui view=full content_node=$Enfants:item}
{/section}

into

{section var=Enfants loop=fetch(content, list, hash(
parent_node_id, $DesignKeys:used.node,
class_filter_type, include,
class_filter_array, array( 'infos' ) ) )}
{node_view_gui view=full content_node=$Enfants:item}
{/section}

Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

laurent le cadet

Thursday 14 April 2005 1:56:37 am

The first change makes the content disapppear and the second one give me an empty default view and ask me to create a template (???).

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.