- Posts: 438
COMMUNITY FORUM
How do you apply urlencode to Extra Field alias?
- Joe Campbell
- Topic Author
- Offline
- Platinum Member
Less
More
10 years 6 months ago #126389
by Joe Campbell
How do you apply urlencode to Extra Field alias? was created by Joe Campbell
I am able to apply the following urlencode to static text, with the following code...
<?php echo(urlencode('Any Text Here')); ?>
I am also able to display the Extra Field, with the following code...
<?php echo $this->item->extraFields->AliasHere->value; ?>
How do I combine the two, to dynamically apply the urlencode to the Extra Field that I want displayed?
<?php echo(urlencode('Any Text Here')); ?>
I am also able to display the Extra Field, with the following code...
<?php echo $this->item->extraFields->AliasHere->value; ?>
How do I combine the two, to dynamically apply the urlencode to the Extra Field that I want displayed?
Please Log in or Create an account to join the conversation.
- Lefteris
- Offline
- Moderator
Less
More
- Posts: 8743
10 years 6 months ago #126390
by Lefteris
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Lefteris on topic Re: How do you apply urlencode to Extra Field alias?
Hi. You can't do this easily. The value holds also the a tag so you need to process it first with a regular expression. The question here is: why you need to do this?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Joe Campbell
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 438
9 years 6 months ago #142021
by Joe Campbell
Replied by Joe Campbell on topic Re: How do you apply urlencode to Extra Field alias?
I need it to pass extra field values to non-javascript social media share links:
danielmiessler.com/blog/social-media-buttons-no-javascript/
danielmiessler.com/blog/social-media-buttons-no-javascript/
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 6 months ago #142028
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: How do you apply urlencode to Extra Field alias?
Wouldn't you need the Absolute URL of the item instead?
$this->item->absoluteURL
Now if you want to combine a text field you can do the following:
$this->item->absoluteURL
Now if you want to combine a text field you can do the following:
<?php echo ( urlencode($this->item->extraFields->AliasHere->value)); ?>
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.