echo title with php

  • carla
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0

carla created the topic: echo title with php

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.
#237304
  • Posts: 5896
  • Karma: 118
  • Thank you received: 544

MarioPuco replied the topic: echo title with php

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

Satisfied with our Support ?
PayPal Tip
===============================================
Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#237317
  • carla
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0

carla replied the topic: echo title with php

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!
#237321
  • Posts: 5896
  • Karma: 118
  • Thank you received: 544

MarioPuco replied the topic: echo title with php

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

Satisfied with our Support ?
PayPal Tip
===============================================
Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#237322
  • carla
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0

carla replied the topic: echo title with php

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?
#237325
  • Posts: 5896
  • Karma: 118
  • Thank you received: 544

MarioPuco replied the topic: echo title with php

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

Satisfied with our Support ?
PayPal Tip
===============================================
Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#237326
Moderators: tomeperica
Time to create page: 0.392 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

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

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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 to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here