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.

eZ debug

Timing: Jan 18 2025 22:13:36
Script start
Timing: Jan 18 2025 22:13:36
Module start 'layout'
Timing: Jan 18 2025 22:13:36
Module start 'content'
Timing: Jan 18 2025 22:13:37
Module end 'content'
Timing: Jan 18 2025 22:13:37
Script end

Main resources:

Total runtime0.8919 sec
Peak memory usage4,096.0000 KB
Database Queries104

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 589.0703152.6250
Module start 'layout' 0.00490.0024 741.695339.4453
Module start 'content' 0.00730.8832 781.1406886.4688
Module end 'content' 0.89050.0013 1,667.609436.1563
Script end 0.8918  1,703.7656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00260.2960160.0002
Check MTime0.00110.1272160.0001
Mysql Total
Database connection0.00080.090810.0008
Mysqli_queries0.766785.95941040.0074
Looping result0.00100.11741020.0000
Template Total0.867397.220.4336
Template load0.00170.193220.0009
Template processing0.865597.042320.4328
Template load and register function0.00020.021610.0002
states
state_id_array0.00060.065310.0006
state_identifier_array0.00120.131320.0006
Override
Cache load0.00180.20621330.0000
Sytem overhead
Fetch class attribute can translate value0.00060.067560.0001
Fetch class attribute name0.00120.1354200.0001
XML
Image XML parsing0.00390.442660.0007
class_abstraction
Instantiating content class attribute0.00010.0060270.0000
General
dbfile0.00330.3703380.0001
String conversion0.00000.000540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
16content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
15content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
31content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
11content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 78
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs