Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • trfletch 598 posts 604 karma points
    Jul 17, 2009 @ 15:06
    trfletch
    0

    Doc2form new node name

    Hi,

    I am using doc2form for a comments section on my website, the form creates a new node as a child node of the page the form is on, currently it names the child node the same name as the parent node but with RE: at the start. Is there a way to specify what the child node created by the doc2form will be called? Ideally I would like it to get its name from one of the fields on the form. Any ideas?

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jul 17, 2009 @ 15:11
    Ismail Mayat
    0

    trfletch,

    Not sure which version you have but my hacked version allows you to pass in property to use to name the document the macro field is called PageTitleFieldAlias.

    Regards


    Ismail

  • Ron Brouwer 273 posts 768 karma points
    Jul 17, 2009 @ 15:19
    Ron Brouwer
    0

    Hi Trfletch,

    Not realy the answer to your question to be honest, but you could use the Axendo Form Designer to solve that problem.
    http://www.axendo.nl/umbraco-packages/axendo-form-designer

    Ron

  • Dan Evans 629 posts 1016 karma points
    Jul 17, 2009 @ 16:13
    Dan Evans
    1

    There are 2 properties of the Macro you need to set:

    ShowTitle="1" TitleName="LabelName"

    This will then add a form field to the form with the label "TitleName" which will then get saved as the node name.

    Dan

  • Martin Bentzen 83 posts 145 karma points
    Jul 17, 2009 @ 16:15
    Martin Bentzen
    101

    Hi,

    You can use the two properties at Doc2Form to specify the nodename:

    ShowTitle="1"  <--- This specify that the user should enter the title (nodename). If not specified, then RE:[nodename] is used.

    TitleName="" <--- This is the label shown to the user for the textbox for entering the title (nodename)

    Note: The title/nodename control will be the first one.

    Hope that help you further.

    Martin

  • trfletch 598 posts 604 karma points
    Jul 17, 2009 @ 17:23
    trfletch
    0

    Excellent, this is just what I need, basically I wanted the Comment to be called by the name of the person posting the comment, so now I can have show title set to 1, put "Name" in TitleName and remove the field I am currently using for Title Name.

  • Torben Jensen 13 posts 35 karma points
    Aug 12, 2010 @ 15:15
    Torben Jensen
    0

    This is an OLD subject, hope it's OK I update a bit :)

    I have just made doc2form work after some experimentation, but found the limitation of nodename a bit annoying. Specifically I was missing an option to have a nodename different from RE:... and still not bother users with an input field with nodename.

    So this is what I did (explained for noobs like myself...)

    1) added new property to doc2form macro: CustomNodeName of TEXTSTRING type

    2) modified doc2form.ascx.cs. See changes I made at http://pastebin.com/jaJwVQdN

    Find the cs file in /app_code directory on your site. Remember do NOT make a backup in same directory of the cs file, all files in that directory is parsed and you will get an error about already defined namespace. (may seem obvious, but took me a while to discover). So copy a backup into a local drive and store it.

    3) I can now use macro parameter CustomNodeName in macro calls to set nodename to whatever I choose. Users do not have to type anything.

    For those that did not know: you can put various parameters into the macro call. This is explained here: http://our.umbraco.org/wiki/reference/templates/umbracomacro-element

    Example: site.local/commentpage.aspx?nodename=helloWorld   where you catch helloWorld using CustomNodeName ="[@nodename]". Alternatives are comma separated, as in CustomNodeName="[@nodename],Alternative_Title_here"

    Thank you to creators of doc2form for making it SO simple to improve!

    Use this if you like. No warranty!

     

  • Brian Juul Andersen 44 posts 98 karma points c-trib
    Nov 08, 2012 @ 15:04
    Brian Juul Andersen
    0

    It saved my bacon Torben !! You rock ! ;)

Please Sign in or register to post replies

Write your reply to:

Draft