-
- 54 Posts
Hey guys,
Been banging my head against the wall recently as I am trying to move away from using the default Articles author pages in favor of some custom resources.
I have setting some extended fields which contains a "uid" with the value or the resource id. I then used the following code in the top of my "ArticlesRowTpl" chunk.
[[!Profile? &user=`[[!+createdby]]` &prefix=`user.` &useExtended=`true`]]
<!-- [[!+createdby]] - [[+user.uid]] - [[~[[+user.uid]]]] -->
[[!+createdby]]
Returns the correct user id for each blog post
[[+user.uid]]
Returns the correct resource id for the first blog post and then the same id for all other blog posts
[[~[[+user.uid]]]]
Same as above but returns a url as required
I am not sure why it doesn't get the users details for each respective user and instead only get's it for the first blog post.
I would appreciate any help possible with this please.
Many thanks,
Jonathan
[ed. note: jonrawlins last edited this post 10 years, 8 months ago.]
-
- 24,544 Posts
The createdby tag is uncached, so try making the other tags uncached:
The second one might have to be one of these:
-
- 54 Posts
Thanks Bob, unfortunatly I have tried these previously and they didn't work. It's really odd. It's almost like it parses the first then caches for the rest. That is the impression I get, and no matter what I change it just will not output all the others.
-
- 24,544 Posts
Caching can get kind of funky when you have a snippet whose properties are tags that's inside a chunk that's being used in an iteration by yet another snippet. Sometimes the placeholders are just not set at the time you need them.
What, exactly, is in user.uid? Is it the ID of a Bio page for the user?
-
- 54 Posts
Hi Bob, sorry for the delay in responding, I was away over the weekend and out of the office with meetings yesterday so haven't had a chance to reply.
Basically user.uid holds a resource id which is a users bio page. If it links through to the bio page then it will display their Bio, blog's and Twitter / Google Plus buttons etc.
-
- 24,544 Posts
What you're doing is probably much faster than using an extended field. As long as you don't need the zip field for anything else, it's a great solution.