Share » Forums » General » how to create a news handler like...

how to create a news handler like facebook?

how to create a news handler like facebook?

Tuesday 28 July 2009 9:09:08 am - 2 replies

Author Message

Max Keil

Tuesday 28 July 2009 4:24:36 pm

Hi Marc,

if I understand your problem correctly:

You want that your customer can create simple news within their own folders?

It's really "eZ":
Create a form in the owner view or on the blog view:

<form action="{'/content/action'|ezurl(no)}" method="post">
<input type="hidden" name="ClassID" value="#CLASS ID FOR NEWS#" />
<input type="hidden" value="#ID WHRE TO CREATE#" name="NodeID" />
<input type="hidden" value="#ID WHRE TO CREATE#" name="ContentNodeID"/>
<input type="hidden" value="#OBJECT ID WHERE TO CREATE#" name="ContentObjectID"/>
<input type="hidden" value="eng-GB" name="ContentLanguageCode"/>
<input type="submit" value="Create here" name="NewButton" />
</form>

After submitting this form you should be redirected to the edit view of your blog, where the customers can create their own news.
To ensure that not everybody can do that or see the button - you should set up some roles & policies - something like "content"->"create"->"class news"->"parent owner self"

To hide the button from foreign eys you can check is the current user has access to create some news in the current folder.

{def $access=fetch( 'user', 'has_access_to',
                    hash( 'module',   'content', 'function', 'create' ) )}

{if $access}
SHOW FORM
{/if}

I hope this can help you at your way.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

marc marc

Tuesday 11 August 2009 2:58:21 am

many thanks to your helpful answer, it seems a bit more clear for me now, i will check that direction.
:-)

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

36 542 Users on board!

Forums menu