• Resolved fatih71

    (@fatih71)


    Hello,

    How to show current post title in DS while the form is placed in that post.

    So if i place the form in another post with different title, the DS shows the title of that post.

    Thank you

    Fatih

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @fatih71

    First, you should know that every additional attribute passed to the form’s shortcode, would be transformed into a global javascript variable with the value of the attribute.

    So, assuming your form id is 1, you can insert the shortcode as follows:

    [CP_CALCULATED_FIELDS id="1" post_id="123"]

    of course, in this case the values are hypothetical, but you should pass the id of the post through the shortcode.

    and now the query associated to the DS field would be similar to:

    SELECT post_title as value FROM {wpdb.posts} WHERE ID=<%post_id%>

    and that’s all.
    Best regards.

    Thread Starter fatih71

    (@fatih71)

    Thank you for your answer.

    Is it possible to calculate the post_id like jQuery(‘#post_id’).val()
    and replace post_id=”123″ with post_id=”<%fieldname#%>”

    Plugin Author codepeople

    (@codepeople)

    Hi! We’d like to help but we can’t reply about that in this forum. We are not allowed to support any customers in these forums.

    For pro or commercial product support please contact us directly on our site. This includes any pre-sales topics as well.

    Commercial products are not supported in these forums. We will happily answer this and any other questions you can have on our own site.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how to get current post id’ is closed to new replies.