Search
Other Components Anywhere questions
Forum

Insert current id into url

Odin Mayland's Avatar Odin Mayland
Is there a way to use the tag id from the current url?

{component url="index.php?option=com_tags&view=tag&id=CURRENT"}
Peter van Westen's Avatar Peter van Westen ADMIN
No, there is no built in way in Components Anywhere to do that.
You would have to use php code (via Sourcerer for instance) to collect that data and echo out the url.
Please post a rating at the Joomla! Extensions Directory
Odin Mayland's Avatar Odin Mayland
When I try this:
{component url="index.php?option=com_tags&view=tag&id={source}[php:start] echo $_GET['id']; [php:end]{/source}"}

I get this:
<!-- Components Anywhere Message: The component cannot be placed because an invalid URL is given or the page timed out. -->

Is this the right php and syntax?
Peter van Westen's Avatar Peter van Westen ADMIN
Make sure the Sourcerer plugin is ordered before Components Anywhere.
And what are these [php:start] tags you are using?
Please post a rating at the Joomla! Extensions Directory
Odin Mayland's Avatar Odin Mayland
I assumed the odd [php:start] tags were from JCE.

Regardless, I manually typed in the right php syntax and it works!
{component url="index.php?option=com_tags&view=tag&id={source}<?php echo $_GET['id']; ?>{/source}"}
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription