External link with user data as menu item?

General questions relating to Joomla! 3.x. Please consider the availability of third-party templates and extensions when deciding which Joomla version to use.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
ruraldev
Joomla! Intern
Joomla! Intern
Posts: 62
Joined: Fri Jun 30, 2006 5:57 pm

External link with user data as menu item?

Postby ruraldev » Tue Jan 23, 2018 4:18 pm

Hi

I'm wondering if it is possible to create a menu item which is a link to an external website but with custom user fields attached to the url, I know how to retrieve the custom data for an article etc but wasn't sure how to use them in a menu item.

End result: http://www.example.com/index.php?username=[user]&password=[pass]

I'm open to other ideas which produce the same result

Thanks

Gordon

User avatar
Jeyjoo
Joomla! Explorer
Joomla! Explorer
Posts: 341
Joined: Tue Jul 19, 2011 8:56 am
Location: Monaco
Contact:

Re: External link with user data as menu item?

Postby Jeyjoo » Wed Feb 07, 2018 8:53 pm

Interesting challenge. You can use javascript to change the actual value of the href in the anchor.

<a href="#" id="changebutton">click this button to change link</a>
<a href="#" id="myLinkToChange">menu link text</a>

<script type="text/javascript">
document.getElementById("changebutton").onclick = function() {
document.getElementById("myLinkToChange").href="https://newsite.com/newlink.php";
return false;
};
</script>


Return to “General Questions/New to Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 25 guests