Home › Forums › Quform WordPress › Fill field with variable with command in the theme file
- This topic has 6 replies, 2 voices, and was last updated 10 years, 1 month ago by lucmercx.
- AuthorPosts
- December 9, 2013 at 8:52 pm #7790lucmercxParticipant
Today we use Quform to enable visitors to get an offer for one of our tours. I send the name of the page with a variable to the form. No problem as we have only one tour on a page at this moment. Example: http://english.originaltours.nl/beer-tour/
What we would like to add is an inquiry from right form the page with all the tours (example: http://english.originaltours.nl/city-tour/). So we will add a button next to the “read more” button, only this one will activate a pop-up quform. How can I now include the name of the specific tour the visitor clicked on? In other words, fill a field on a form with the proper title?
I’m familiar with the include in theme-file command but how can I include the
<?php the_title() ?>
in the following line so it will fill the right form field with the title from the tour?
<?php if (function_exists('iphorm_popup')) echo iphorm_popup(5, 'Request an offer'); ?>
Thanks very much in advance…
December 10, 2013 at 5:16 pm #7806AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
March 25, 2014 at 3:57 pm #9313lucmercxParticipantHello Ally,
When I use this line the form will not “popup”. In fact it only returns to the top of the page.
I used this line:
<?php if (function_exists('iphorm_popup')) echo iphorm_popup(2, 'OFFERTE AANVRAGEN', 'tour=' . get_the_title()); ?>
On this site: http://www.stadswandelingen-in-amsterdam.nl/type/wandel/
I use it on the button “Offerte aanvragen” (request an offer).
March 25, 2014 at 5:15 pm #9319AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
March 26, 2014 at 8:19 am #9332lucmercxParticipantDear Ally,
Thanks for your reply, I have done the following:
– update to 1.4.14
– Placed the line:
<?php if (function_exists('iphorm_popup')) echo iphorm_popup(2, 'OFFERTE AANVRAGEN', '','tour=' . get_the_title()); ?>
No form will pop-up. If I add an empty variable in the line so the filling of variable tour is on the fourth position, it will work, only it shows on the form the title of the first event, no matter which button I use.
<?php if (function_exists('iphorm_popup')) echo iphorm_popup(2, 'OFFERTE AANVRAGEN', '','tour=' . get_the_title()); ?>
I have here the code used to generate the page with a list off all events:
{foreach $posts as $item}
{first}<ul class="items">{/first}
<li class="item clear{ifset $item->packageClass} {$item->packageClass}{/ifset}{ifset $item->optionsDir['featured']} featured{/ifset}">
{if $item->thumbnailDir}
<div class="thumbnail">
link}">thumbnailDir, w => 155, h => 115}" alt="{__ 'Item thumbnail'}">
</div>
{/if}
<div class="description">
<div class="desc-head">
<h3>link}">{$item->title}
<div class="item">min. <?php the_field('personen'); ?> personen | tijdsduur <?php the_field('tijdsduur'); ?></div>
</h3>{if $item->rating}
<div class="item-rating">
{for $i = 1; $i <= $item->rating['max']; $i++}
<div class="star{if $i <= $item->rating['val']} active{/if}"></div>
{/for}
</div>
{/if}
{var $lp = getTourPrice($item->id)}
{if $lp}<div class="item-price"><span><span>{$lp}</span></span></div>{/if}
</div>
<div class="desc-text">
link}">{!$item->excerpt}
</div>
<div>
<div class="sc-button"">
<span class="border"><span class="wrap"><span class="title"><?php if (function_exists('iphorm_popup')) echo iphorm_popup(2, 'OFFERTE AANVRAGEN', '','tour=' . get_the_title()); ?></span></span></span></div>
<div class="sc-button">
<span class="border"><span class="wrap"><span class="title">link}">LEES MEER</span></span></span></div>
</div>
</div>{last}{/last}
{/foreach}
I’ve stripped the code from inline styles.Thanks in advance…
March 31, 2014 at 10:22 am #9366AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
April 1, 2014 at 9:56 am #9399lucmercxParticipantThanks, this does the trick. The item van be closed now. Thank you very much for the good support!
- AuthorPosts
- You must be logged in to reply to this topic.