• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Can I edit the page title?

Can I edit the page title? 4 years 1 month ago #41048

Hello,

I'm using the page title in my admin mail. The value is {page:value}. But the url is too long and I want to use only a part of that. Is it possible to edit the {page:value} before I use it in the admin email?

Thanks
Kees
The administrator has disabled public write access.

Can I edit the page title? 4 years 1 month ago #41059

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

You can try something among these steps:

- add a hidden field in your form.

- use a PHP script within "Scripts called on form process" area where you can take the page title value and split it further as as needed while also adding this new value in your hidden field value.

- eventually in your email, use the hidden field's placeholder instead.
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.

Can I edit the page title? 4 years 1 month ago #41060

Hello Adrian,

Thanks. Unfortunately I'm not a PHP expert. So maybe you can help me something more.

I have two hidden fields:

the first is called {page} and gets the url form the page with
//<code>
$u = RSFormProHelper::getURL();
return $u;
//</code>

The second is added as you suggest. Let's say with the name {hidden}.

Within "Scripts called on form process" area I placed this:
$str = {page:value};
$string2 = ltrim($str,"here comes what i want to trim");

How can I get the result $string2 in the {hidden;value} field to display that value in the mail?

Thanks
Last Edit: 4 years 1 month ago by kees.de.goeijer.
The administrator has disabled public write access.

Can I edit the page title? 4 years 1 month ago #41061

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

Placeholders won't work as plain text within a scripting area. You'll need to grab and set field values using $_POST.

For example, if you want to limit the string to the first 30 characters of your page field value, you would use:
$_POST['form']['hidden'] = substr($_POST['form']['page'], 0, 30);

If you really want to left trim your string, then:
$_POST['form']['hidden'] = ltrim($_POST['form']['page'], "exact string to be trimmed here");
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.
The following user(s) said Thank You: kees.de.goeijer

Can I edit the page title? 4 years 1 month ago #41062

Your last answer helps me very good. Thank you.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!