Search
Other Sourcerer questions
Forum

Displaying Custom Fields

David Hillock's Avatar David Hillock
Hi Peter,

Sorry, this is not a pre-sales or bug report....

For the Sourcerer, you provided an example of how to display the user->name, and that works.

I'm trying to display two custom fields in an article: first-name and date-paid. Would you be able to provide a code snippet for doing that, please.

Appreciate your help in getting me going here.

David
Peter van Westen's Avatar Peter van Westen ADMIN
Why not use Articles Anywhere for that?
Please post a rating at the Joomla! Extensions Directory
David Hillock's Avatar David Hillock
Okay, I've looked at Articles Anywhere, but I cannot get that to work for my custom fields.

I first created an article, and then I'm referencing it in a custom component...as the component will only be displayed on certain days, and for specific members. Here is the content for the custom component.

{article title="Check Your Email Address Please"}
This is the article text: [text]
This is your first name: [first-name]
This is your date paid: [date-paid]
This is your email address:[email]
{/article}

As it turns out, the above works, except that first-name and date-paid (custom fields) are displayed literally...meaning that "[first-name]" is displayed, instead of "David"

Also, email is not a custom field, do I need to do something different to get that data?

Finally, I did try this to simplify:
{article title="Lions"}[first-name]{/article}

Which was from the Custom Fields example, but I just changed habitat-area to first-name.

Your feedback and help is appreciated.

David
Peter van Westen's Avatar Peter van Westen ADMIN
Oh, are these not article custom fields, but fields attached to your users?
Then indeed, Articles Anywhere won't help you.

To output custom field values attached to users (or other things) I suggest you google or look on the Joomla forum for that.
www.google.com/search?q=joomla+output+custom+field+user
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription