Publish article to multiple nodes?

Author Message

Joanie Chembars

Wednesday 04 May 2005 11:08:28 am

Hi =
Looking for a clue here........
I want to be able to publish articles to multiple locations automatically when they are created. I have searched and can't seem to find how to do this.... any ideas??? I need to be able to do this so I can pull the RSS feeds I need for the information to be reused.
Thanks for any ideas ---
Joanie

Marko Žmak

Wednesday 04 May 2005 3:24:59 pm

I'm also interested in this... And also how to create more then one node at once?

For example if I want to create a node with some subnodes at once by filling only one form on the user site.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Michael Zeidler

Wednesday 04 May 2005 3:34:32 pm

You could use related objects. If you dont want to alter the templates you could insert these related objects like you would do it with images.
Assume you have added a folder as related object to another folder and you have inserted this related object inside the "short description"-field during processing the template the default embed-template, which depends on the class of the inserted object, would be included at the place.
Another way is just to add a related object and alter the full-folder-view-template like you want. Within this template you have to fetch the related objects, collect the node_ids which are used to get the children of these related objects. As the appropriate fetch-mechanism can handle an array of parent_node_ids you get the children at once. This way sorting and rendering children of different nodes for display is quite easy.

Cheers!

-------------------------------------------------------------------------------------------
join #ezpublish on irc.freenode.org

Bruce Morrison

Wednesday 04 May 2005 5:08:14 pm

Hi Joanie

You basically modify the edit templates associated with placement.

See
design/standard/templates/content/edit_placement.tpl

There is a comment at the top of this template that give a hint/guide at how this is done.

The form variables to look at are
SetPlacementNodeIDArray
SetRemoteIDOrderMap
SetRemoteIDFieldMap

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Michael Zeidler

Wednesday 04 May 2005 10:55:31 pm

Did I get something wrong? Shouldnt be the placement to several locations be done automatically? Bruce, what is the result of the modification you are suggesting? Doesnt fit the the location function within the admin-interface for what you are proposing?

-------------------------------------------------------------------------------------------
join #ezpublish on irc.freenode.org

kracker (the)

Wednesday 04 May 2005 11:22:06 pm

What I hear Bruce saying is this ...

To publish to multiple locations (during creation / instantiation of the content object) you must create a template override of the file:

design/standard/templates/content/edit_placement.tpl

Once you have created a template override of the file you can customize it to contain the information needed to publish a single content object (say: article) to multiple locations (say: folders).

The relevant variables to customize are:

SetPlacementNodeIDArray
SetRemoteIDOrderMap
SetRemoteIDFieldMap

You will want to use at least one of these variables (duplicate the form entries to build an array using hidden form fields) to achieve your multi-location-placement-on-content-object-creation ...

<input type="hidden" name="SetPlacementNodeIDArray[]" value="{$Node:item.parent_node}" />
<input type="hidden" name="SetPlacementNodeIDArray[]" value="{$altParentNode}" />

Ok so I have to tell you that there is a really good chance that you will need a combination of the above variables to be set via html hidden form fields, instead of just any one variable.

If you read the source code you will see a section that will exit if all the variables are not defined.

With that said I don't entirely understand what values are expected / required for : SetRemoteIDOrderMap, SetRemoteIDFieldMap ....

<i>References:
http://www.ez.no/community/forum/setup_design/problem_adding_content_using_own_edittpl
http://pubsvn.ez.no/viewcvs/ezp/stable/3.5/kernel/content/node_edit.php?rev=10652&view=log
http://pubsvn.ez.no/websvn/filedetails.php?repname=nextgen&path=%2Fstable%2F3.5%2Fkernel%2Fcontent%2Fnode_edit.php&rev=0&sc=1
http://pubsvn.ez.no/viewcvs/ezp/stable/3.5/kernel/content/node_edit.php?view=markup
http://www.google.com/search?hl=en&q=SetPlacementNodeIDArray&btnG=Google+Search
</i>

hack harder...
//kracker

<i>All the television children have grown to become addicted to www tune out the meaning ..." --|</i> Alias : Pill Hiding

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Marko Žmak

Wednesday 04 May 2005 11:55:41 pm

I don't know for Joanie but this advices from Bruce and kracker sure suite me. Thx.

But still have one unresolved question. How can I create more than one object with only one user form? I wan't to create an object and several other objects that are his children. Is this possible?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

kracker (the)

Thursday 05 May 2005 12:15:46 am

Good follow up question,

Though, <i>honestly</i> I still think that new questions are best suited in a new forum thread that you link to from here instead of asking directly here.

This makes is simpler to search for solutions by name rather than reading a really really long thread about 2 - 4 questions.

Still that said, I'll throw down my 2cents even if it makes not sense.

I think this is possible, I don't know how or why but I do ...

<i>waiting for them to prove me wrong ...</i>

My first guess would be a template that had the form fields for not just 1 but (at least) 2 sets of the form fields for each object on the same submit form.

I would think that the kernel can support this with the use of a specific feature it provides, which one I don't know.

The second thought I have is if it truly isn't possible out of the box it wouldn't take too long to build an extension to support the looping over your multi-object / overloaded / html form fields as arrays form information submitted to eZ publish and insert each object one at a time from the same form..

If you need to keep talking about this 2nd question, please create a new thread.

respectfully,
//kracker

<b>Alias : Final Act</b>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Joanie Chembars

Thursday 05 May 2005 3:44:30 am

Thanks for all the input everybody. I will give this a shot as soon as I can.

My life sure would be a lot easier if I could do a direct query to the mysql dbase to pull out articles by user to use in a php site !!!

kracker (the)

Thursday 05 May 2005 4:05:03 am

Joanie,

A lot of (comfortable) php developers often hold / reiterate that opinion.

At times of frustration I would probabilly breakdown and say the same thing.

Like many things with eZ publish you must learn to live inside a framework designed to abstract any single implementation into a flexible, customizable collection of layers of features which are intentionally broken up into smaller pieces than the average php applications / frameworks.

An extension could be developed to provide eZ publish content / articles to another php application. On second thought it might be simpler to provide an eZ publish rss feed of your content for another php application to reuse ?

eZ publish, in the end, requires an investment of time, reading, learning, practice (repeat 7x) for it's successful mastery ... but in most cases it's an investment over time; not all at once.

I guess the question is ... <i>is eZ publish worth the investment to you ?</i>

<i>These are My thoughts, My words, My mind. Your Results / Interpretations</i> <b>will</b> <i>vary ... they are all so multi-faceted that way ;) </i>

//kracker

Non-Prophets : Fresh
Non-Prophets : Mainstream 307
Non-Prophets : Spaceman`

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Brendan Pike

Friday 20 May 2005 3:01:41 am

Like most your reponses kracker it's a very good one. I am looking into achieving this also, Joanie if you suceeded would you be able to provide more exact details of how you did this. I'm looking to allow forum topics and replies to be published directly under articles but also want the main node to be held in the true forum area. So know howing you went would be helpful.

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Marko Žmak

Friday 20 May 2005 5:42:02 pm

I tried to do something with this but encountered some difficulties. See:

http://www.ez.no/community/forum/setup_design/publish_article_to_multiple_nodes_2

The object can be published to multiple nodes, but I couldn't find out how to do it using only one form...

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Brendan Pike

Monday 23 May 2005 4:41:56 am

Thanks for the reply Marko, hopefully someone can tell us how this can be achieved. Any takers?

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Marko Žmak

Monday 23 May 2005 2:43:25 pm

I hope so too. But seeing the way eZ works, and since no one answered this question for a long time I doubt it can be done using only one form...

But I still hope someone proves me wrong... :)

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Bruce Morrison

Monday 23 May 2005 4:23:16 pm

Hi Marko

>I hope so too. But seeing the way eZ works, and since no one
> answered this question for a long time I doubt it can be
> done using only one form...
>
> But I still hope someone proves me wrong... :)

Apologies for not providing a step by step solution. I've given you some more hints at your other thread at http://www.ez.no/community/forum/setup_design/publish_article_to_multiple_nodes_2

If you are unsatisfied with the free advice you are getting in the forums then you have a number of other options:
+ Take advantage of the support services provided by eZ or the partners
+ Read the source code and work it out yourself.

There are many things that eZ publish is capable of that are not initially evident, often these require that _you_ do a bit of detective work.

The beauty of open source software is that you have access to the source and are able to work out the solution, so of you don't get an answer in the forums then maybe it's up to you to find a solution.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Joanie Chembars

Tuesday 14 June 2005 10:42:19 am

Just an update here --
I figured out that to make my rss feeds work, I don't need to publish to multiple nodes -- I just created a content structure like this --
-UserGroupA
--user1
--user2
--user3 etc...

And then changed the fetch function in the ezrssexportitem.tpl to go 2 levels deep --
and bing-bang!! solved the problem.

Don't want to tell you all how long I have been banging my head over this one.
Maybe this will help somebody else.......

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