Sometimes, using radiant to build a site, I need to generate many pages with the same page parts and the same contents, aside a few things..instead of copy all the page parts and all the contents I created the Radiant Duplicate extension. It adds a new action (duplicate) near the ‘Add child’ button:

Radiant Duplicate extension

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Technorati
  • Reddit
  • Furl

3 Responses to “Radiant Duplicate extension”

  1. Mario T. Lanza Says:

    It was necessary to fix the duplicate extension because the “Copy whole tree” option wasn’t recursive enough. It went only 2 generations deep. Here’s the revised method:

    def duplicate_children source_page, dest_page, recursive = false
    source_page.children.each do |page|
    new_page = duplicate_page page, dest_page
    if recursive
    page.children.each do |sub_page|
    new_page = duplicate_page sub_page, new_page
    duplicate_children sub_page, new_page, true
    end
    end
    end
    end

  2. Mario T. Lanza Says:

    Second issue (relates more to Radiant’s design):
    The addition of the “Duplicate” link to the standard Radiant interface only works if other extensions aren’t competing to modify that interface. For example, in the latest 0.6.1 version the Reorder extension modifies this interface. As a result I don’t get the Duplicate link. I had to modify the Reorder extension to include the Duplicate link.

    Anyway, your extension was *much needed* and very welcome!! Thank you.

  3. andrear Says:

    Hey Mario, thank you very much for your patch..I know the second issue..but it will be better in Radiant 0.6.5..I’m waiting for this version to improve my extensions..tnx again!

Leave a Reply