TOPIC:

echo title with php 4 years 1 month ago #237304

  • Topic Author
  • carla
  • Offline
  • Junior Member
  • Junior Member
  • Registered
  • Posts: 37
  • Thanks: 0
We have created a system where an email is sent when someone visits a certain contentbuilder page (it is hard to explain why, so please just go with it). We want to echo the title of the page (within contentbuilder view) in our email. What can I use in php to echo the title? Thanks in advance for any help. We only use contentbuilder, so no breezingforms.

Please Log in or Create an account to join the conversation.

echo title with php 4 years 1 month ago #237317

  • MarioPuco's Avatar
  • MarioPuco
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 5957
  • Thanks: 558
Hi,

Can you try this :

1 ) Create a new textfield, give it name "title".
2 ) Go to this elements advance options and enable "readonly"
3 ) In advance options from this element go to :
Initscript > Custom > check "Form Entry" > Press "Create Code framework and add this within the code framework :
ff_getElementByName('title').value  =  document.title;

But basically with document.title you can get the document title and insert it anyway that fits your current design.

Regards,
Mario

Please Log in or Create an account to join the conversation.

echo title with php 4 years 1 month ago #237321

  • Topic Author
  • carla
  • Offline
  • Junior Member
  • Junior Member
  • Registered
  • Posts: 37
  • Thanks: 0
Hi Mario,

Thanks for the quick reply, but I think I wasn’t clear with my question. I have php on my page, wirhin that php I want to echo the title of the view. So it is not within contentbuiler, I would just like to know what to use in php to echo the contentbuilder view title. Or any firld for that matter. I have named the title field title. Thank you!

Please Log in or Create an account to join the conversation.

echo title with php 4 years 1 month ago #237322

  • MarioPuco's Avatar
  • MarioPuco
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 5957
  • Thanks: 558
Hey,

What about this ?
echo'
<script>
jQuery(document).ready(function(){
ff_getElementByName('title').value  =  document.title;
});
</script>
';

This will populate the "title" element with document.title.
Would this work ?

Regards,
Mario

Please Log in or Create an account to join the conversation.

echo title with php 4 years 1 month ago #237325

  • Topic Author
  • carla
  • Offline
  • Junior Member
  • Junior Member
  • Registered
  • Posts: 37
  • Thanks: 0
Unfortunately this does not work. I need the php code, so no javascript. I can't implement this script within my php. This gives an error on the page with the page being unreachable. There must be a php way of getting the view title, isn't there?

Please Log in or Create an account to join the conversation.

echo title with php 4 years 1 month ago #237326

  • MarioPuco's Avatar
  • MarioPuco
  • Offline
  • Platinum Member
  • Platinum Member
  • Registered
  • Posts: 5957
  • Thanks: 558
Carla,

I made a error in the code above, please ONCE more try this :
echo'
<script>
jQuery(document).ready(function(){
ff_getElementByName("title").value  =  document.title;
});
</script>
';

If this does NOT work we will find a PHP solution, althogh what am I doing here is echoing a jQuery script with PHP echo.
This should work !

Regards,
Mario

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Time to create page: 0.056 seconds

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Subscribe to news and updates!

Special Offer

Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here and enter the Crosstec channels to receive live support and talk directly to the team!