How to get collectionID (or entryID for custom block) before page is published

Permalink
I turned the basic forum package into a time machine, which essentially publishes comments to new pages. It's basically the guestbook with pages instead of threads of comments.

I'd really like to get the forthcoming comment's entryID or the forthcoming page's cID in an input hidden in the form in my custom block's view.php before the entry is published; the way composer does right here:

ccm_composerSelectParentPage = function(cID) {
    $("input[name=cPublishParentID]").val(cID);
    $(".ccm-composer-hide-on-no-target").show();
    $("#ccm-composer-publish-location").load('<?php echo $this->action("select_publish_target")?>', {'entryID': <?php echo $entry->getCollectionID()?>, 'cPublishParentID': cID});
    jQuery.fn.dialog.closeTop();
}


But is javascript really necessary? There's gotta be an easier way. Can I pull the autoincrement from the entryID (key) in my db.xml and insert a custom value manually? My custom block's form has the entryID when I'm editing, not creating, an entry of course.

In plainer vanilla, I'd like the form to always include an entryID. When the form turns a draft into a published entry, I'd obviously prefer the draft's entryID to carry over.

The following form is a stripped-down version of what powers my time machine...for now...

<form method="post" action="<?php  echo $this->action('fire_it_like_Tom_Cruise_in_Top_Gun'); ?>">
    <textarea rows="4" name="copy"><?php  if ($item->copy) echo $item->copy; ?></textarea>
    <button type="submit" name="Submit"><?php  echo t('Fire it'); ?></button>
    <?php  if(isset($item->entryID)) echo '<input type="hidden" name="entryID" value="'.$item->entryID.'">';
</form>

McCormick
 
McCormick replied on at Permalink Reply
McCormick
If anybody who missed this thread can help out with this, I'd very much appreciate it.