eZ Community » Forums » eZ Platform » Rebuild all url alias for all nodes...
expandshrink

Rebuild all url alias for all nodes for a content type

Rebuild all url alias for all nodes for a content type

Thursday 14 January 2016 2:59:02 pm - 1 reply

I had change url alias rule. How to rebuild path with the new url for all nodes inside a content type.

Friday 15 January 2016 5:49:27 pm

What we do is write a script that re-publishes all the affected nodes:

foreach( $nodes as $node )
{
    $republish = eZOperationHandler::execute( 'content',
                                          'publish',
                                          array(
                                                'object_id' => $node->attribute( 'object' )->attribute( 'id' ),
                                                'version'   => $node->attribute( 'object' )->attribute( 'current_version' ),
                                               )
                                         );
}

Modified on Friday 15 January 2016 5:50:00 pm by Peter Keung

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from