This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » Urls are not pretty after creating...
expandshrink

Urls are not pretty after creating new locations from custom code in ez 4.x

Urls are not pretty after creating new locations from custom code in ez 4.x

Thursday 17 January 2013 10:01:02 am - 4 replies

Hi.

I am importing new content and trying to add new locations for a given object. The nodes created are correctly instantiated, but only the system urls are visible. 

When i edit one of the objects the pretty url is generated.

I have used the following function from the ez4.x api : 

I know that the command below in effect cals the eZNodeAssignment, but still the urls are not pretty.

Any idea? Is there some function i can trigger to have them generated?

$contentObject->addLocation($parentNode);

Friday 18 January 2013 9:45:37 am

Hi Lars,

when you do this kind of operation you have to use an operation handler, in this case something like this:

 eZOperationHandler::execute( 'content',
                                                  'addlocation', array( 'node_id' => $cObj->attribute( 'main_node_id' ) ,
                                                                                  'object_id' => $cObj->attribute( 'id' ) ,
                                                                                  'select_node_id_array' => array( $nodeLocationId ) ) ,
                                                   null ,                             
                                                   true );

Gabriele

Friday 18 January 2013 12:56:59 pm

Thank you Gabriele! 

That definitely made it all work as expectedhappy.gif Emoticon

Thanks for taking the time.

Allthough i have used lots of the apis, i allways tend to forget looking at the ezoperationhandlerhappy.gif Emoticon

Friday 18 January 2013 1:29:41 pm

Same problem for me happy.gif Emoticon

Unfortunately the documentation is not so clear for these topics.

Generally I check what eZ team do in admin interface

 

Gabriele

Saturday 19 January 2013 11:25:52 am

Sample code for manipulating content can be found as well in extensions such as:

- ezworkflowcollection

- ezcontentstaging

- data_import

Always pimping my own stuff, I know ( blunk.gif Emoticon )

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from