eZ Community » Forums » Developer » Creating nodes in frontend and...
expandshrink

Creating nodes in frontend and categorization

Creating nodes in frontend and categorization

Thursday 12 April 2012 1:42:06 pm - 3 replies

Hello community,

I'm working on a project where the register users can create a node in the frontend to add content to the site. I have a folder hierarchy (categories) where my users can create the nodes using the eztoolbar when they are logged in.

Do you know if there is anyway to let them choose the category in the editor? something like a dropdown or similar will be perfect. It can be confusing if they have to move to the right category to publish the node.

 

Any help is welcome. Thanks for your time happy.gif Emoticon

Thursday 12 April 2012 8:48:46 pm

hello,

 

you can try to ovveride the eztoolbar to add a list of your category.

then you can on the event onchange

  • you can redirect your user to the category page ...
  • or
  • change the node_id;contentobject_id ... which is send to ezpublish to know where it is when you create the article.( line 112 - 124 of the website_toolbar.tpl)

I prefer the 1rst solution because it is simplier.

see you

 

Alexandre

Friday 13 April 2012 8:51:10 am

Hi Alexandre,

 

I like your proposals and I'm going to try them.

Do you know how I can display the list of categories in eztoolbar?

 

Thanks for your reply happy.gif Emoticon

Friday 13 April 2012 10:09:16 am

Quote from Alejandro Dominguez :

Hi Alexandre,

 

I like your proposals and I'm going to try them.

Do you know how I can display the list of categories in eztoolbar?

 

Thanks for your reply happy.gif Emoticon

Hi Alejandro,

To display the list of categories in eztoolbar you should: 

  • Override the website_toolbar.tpl template from the ezwt extension.
  • Fetch your categories that you want the user to choose from :

              {def $categories = fetch( 'content', 'list', hash( 'parent_node_id', $categories_parent_node_id,                                                               'sort_by', array( 'priority', false() )))}

  • Create a select with the categories :

                       <select name="CategoryID" id="ezwt-create-in-category"> 

                            {foreach $categories as $category}       

                                <option value="{$category.id}">{$category.name|wash}</option> 

                            {/foreach} 

                       </select>

 Then apply one of the solutions mentioned by Alexandre SEBBANE.

Hope this helps!

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from