Forums / Developer / Hiding nodes
Lars Eirik R
Tuesday 23 February 2010 6:54:41 am
Hi.
I need to figure out how to only hide a certain translated article from the contenttree.
As far as I see in the cronjobscript hide.php either a node (meaning all its translations) is visible or hidden.
Is there a way using the api for me to rewrite this and have it check for a given translated version of the content?
Basically we need to be able to say that the english version of the article should be hidden, but the german version should currently be visible.
Any pointers?
Nicolas Pastorino
Tuesday 23 February 2010 8:05:57 am
Hello!
I am afraid what you want to achieve it not a native feature. From inspecting the nodes' table, you can see how the node visibility is stored:
mysql> describe ezcontentobject_tree; +----------------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------------------+--------------+------+-----+---------+----------------+ ... | is_hidden | int(11) | NO | | 0 | | | is_invisible | int(11) | NO | | 0 | | ... +----------------------------+--------------+------+-----+---------+----------------+
further illustrated by this piece of documentation : http://ez.no/doc/ez_publish/technical_manual/4_x/concepts_and_basics/content_management/node_visibility
In short, the visibility is stored at the node level, and seems to be language-proof, meaning you probably will need to implement some sort of high level, home brew per-language-visibility system to satisfy your needs.
Anyone else has already done this ?
Hope this helped, Cheers !
-- Nicolas Pastorino Director Community - eZ Member of the Community Project Board eZ Publish Community on twitter: http://twitter.com/ezcommunity t : http://twitter.com/jeanvoye G+ : http://plus.tl/jeanvoye
Ekkehard Dörre
Tuesday 23 February 2010 8:15:20 am
Hi Lars,
Perhaps you can make a different approach, for example a translatable checkbox in the object, for hide of this version in this language an a little template coding, like the show comments in article.
{if $node.data_map.enable_comments.data_int} <h1>{"Comments"|i18n("design/ezwebin/full/article")}</h1> <div class="content-view-children"> {foreach fetch_alias( comments, hash( parent_node_id, $node.node_id ) ) as $comment} {node_view_gui view='line' content_node=$comment} {/foreach} </div> {/if}
Greetings, ekke
http://www.coolscreen.de - eZ Publish, Ibexa, SOLR, Elastic Search
Tuesday 23 February 2010 8:32:48 am
Thanks for helping.
I would like to include scheduling, so i probably will have to look at using date comparioson to solve this.
Do you agree that this would affect the menu as well as the full node it self ? How about the cases where someone has embedded this.. i would have to update all of these templates as well?
Thanks.
Wednesday 24 February 2010 1:41:33 am
can you write us the full plan? What do you want to do totally? Please post a more detailed description,
thanks ekke