Contact Form 7 Dynamic Text Extension
[resolved] Populating field on contact form popup with title of item in catablog gallery (5 posts)

  1. wordscant
    Posted 2 years ago #


    I am not very good on php and am trying to do a very complex thing for me, and I am not sure if it is possible with this plugin, but I think it is, thats why I put the question.

    The problem:
    I have a Catablog collection of items displayed in a gallery. In every item (product) I have a CONTACT link which links to a pop up contact form. I want this contact form field (product), filled with the product title.

    The way I display the contact form in a pop-up in the catablog gallery is this

    1. create a contact form whose shortcode is this one: [contact-form-7 id="170"]
    2. Add a new token named %CONTACT-FORM% to Catablog plugin: hacking the CataBlog.class.php file and adding in line 2572 the following line: $values['contact-form'] = do_shortcode('[contact-form-7 id="170"]')
    3. In the Catablog template I add the following code:
      <a class="fancybox-inline" href="#contact_form_popup">CONTACT</a>
      <div class="fancybox-hidden" style="display: none;">
      <div id="contact_form_popup">

      so it displays the contact form in a pop-up whenever I click on the CONTACT link in the Gallery.

    The problem comes here, I am not able to populate the (product) field in the contact form with the item title, which is what I want to do.
    I have tried with this shortcode: [dynamictext dynamicname "CF7_get_post_var key='title'"] but it takes the page title, not the product title.
    I am also able to get the product title with the token %TITLE% on the template, but I dont know how to put it on the contact form pop-up...

    Any ideas?
    Thanks in advance!

    PS: catablog version 1.6.4


  2. sevenspark
    Plugin Author

    Posted 2 years ago #

    Assuming you have a single contact form which is generated on page load, you're going to need a javascript solution (which isn't something this plugin does).

    Keep it simple - have a data attribute for each gallery item, when it is clicked, set the value in the contact form via javascript.

    Hope that helps,


  3. wordscant
    Posted 2 years ago #

    Thank you very much for the answer, at least I know I cannot continue thsi way and I can try another. My javascript knoledge is null...
    I will see how to manage to do it.

    Thanks for your great work in the plugin and being so quick solving our doubts!

  4. wordscant
    Posted 2 years ago #

    Well, I give it for solved as it is not possible to solve my problem via the plugin.

  5. sevenspark
    Plugin Author

    Posted 2 years ago #

    You're welcome :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7 Dynamic Text Extension
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic