• Resolved mogeh

    (@mogeh)


    Hello and thanks for the previous help.

    I want want to add a default message, the post title and the post url
    to a textarea but so far it hasn’t been successful.

    <div><span>Your message (optional)</span>
        [textarea your-message default:post_meta'Hello, I would like to inquire about your property:']
    [cf7-recordset id="cf7-recordset-476" type="post" attributes="post_title" condition="ID={post.id}"]
    [cf7-link-field recordset="cf7-recordset-476" field="your-message" value="post_title"]
    </div>

    with the above, only the post title is displayed but i would want the default
    message to be populated as follows:

    Hello, I would like to inquire about the availability of your property: <a href="#">5 bedrooms detached duplex</a>

    With the post title having the post url or added to the message.

    Thanks in advance.

    • This topic was modified 1 year, 11 months ago by mogeh.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @mogeh

    To create complex data structures, you can use templates (https://cf7-datasource.dwbooster.com/documentation#using-templates). Please, try the following form:

    <template id="my-template">Hello, I would like to inquire about your property: {attribute.post_title}</template>
    <div><span>Your message (optional)</span>
        [textarea your-message]
    [cf7-recordset id="cf7-recordset-476" type="post" attributes="post_title" condition="ID={post.id}"]
    [cf7-link-field recordset="cf7-recordset-476" field="your-message" value="{template.my-template}"]
    </div>

    Best regards.

    Thread Starter mogeh

    (@mogeh)

    Thanks so much.

    I missed it when going through the docs.

    please, how can i also get the post permalink or URL
    into the message field?

    From what i understand, the URL parameter data source is used in
    parsing parameters through the URL.

    I appreciate.

    Plugin Author codepeople

    (@codepeople)

    Hello @mogeh

    You can get it from the database:

    <label>Post URL:<br>[text post-url]</label>
    [cf7-recordset id="post-record" type="post" attributes="guid" condition="(ID) AND ID={post.id}"]
    [cf7-link-field recordset="post-record" field="post-url" value="guid"]

    Best regards.

    Thread Starter mogeh

    (@mogeh)

    Thanks so much.

    I appreciate your assistance.

    Warm regards.

    Thread Starter mogeh

    (@mogeh)

    Thanks so much and the last one on this:

    I would appreciate to get the permalink instead and also merge the post-url label(url) with the message field?

    like so:

    Hello, I would like to inquire about the availability of your property: 5 bedrooms detached duplex

    Thanks and warm regards

    Plugin Author codepeople

    (@codepeople)

    Hello @mogeh

    The logic is just the same used previously:

    <template id="my-template">Hello, I would like to inquire about your property: <a href="{attribute.guid}">{attribute.post_title}</a></template>
    <div id="my-text"></div>
    
    [cf7-recordset id="post-record" type="post" attributes="post_title,guid" condition="ID={post.id}"]
    [cf7-link-field recordset="post-record" field="my-text" value="{template.my-template}"]

    Best regards.

    Thread Starter mogeh

    (@mogeh)

    Thanks so much.

    warm regard.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Insert default message, post title and url to the post title in textarea’ is closed to new replies.