how to create a news handler like facebook?

Author Message

marc marc

Tuesday 28 July 2009 9:09:08 am

hello,

i'm a true beginner in ez publish so be indulgent please :)
i would like to create a news handler, that means that people that have an personal page on the website , can access to a personal admin page and create a news (=a date + few lines) on his personal page , the news will be added to the old ones, like on facebook.
i have no ideas if its possible (probably yes), but i would like to have some clues or hints to help me and find where to start...
i already googled a lot but didn't find anything.

thank in advance.

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.
:-)

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