I need to check all of the tags against the current logged in members tag and display results that match.
So here, if logged in as Andy Knight who has the tag "andy" I would just like to see results where the file uploaded has the tag "andy" and not the file with the tag 'david' or any other tags.
Thanks for this. This code displays both of the files for both of the users.
Logged in as Andy Knight (tag=andy) displays the file with the tag 'andy' and the file with the tag 'david' and equally when logged in as David Sinnet (tag=david) displays the file with the tag 'andy' and the file with the tag 'david'.
The example has two 'files'. The actual file is the same e.g. "ssh-instructions.rtf" but I uploaded them via the repeater, each with a different tag just to test the filtering.
The idea is to upload various files via the repeater and tag them with the same tag as a member so that that member only can view the file.
It's the files within the repeater I need to display/filter not the whole repeater.
Hi Drew,
Nothing is output on the page. If I comment out the if statement, downloads are displayed:
I'm guessing that the issue is with the if statement in some way - could it be anything to do with the following in the debug output
Do you have a field with the ID
tag
in your template?Hi Drew, Yep, here is the template:
That's in a repeater, so it'll be
downloads.tag
.So like this?
Doesn't seem to work either?
What does this output?
Here's the output...
Ok, so your tags are in
$result[0]['downloads'][x]['tag']
withx
being a zero indexed counter.Do you want to check all of those tags, or just the first?
Hi Drew,
I need to check all of the tags against the current logged in members tag and display results that match.
So here, if logged in as Andy Knight who has the tag "andy" I would just like to see results where the file uploaded has the tag "andy" and not the file with the tag 'david' or any other tags.
Does this answer the question?
Hi Drew,
Thanks for this. This code displays both of the files for both of the users.
Logged in as Andy Knight (tag=andy) displays the file with the tag 'andy' and the file with the tag 'david' and equally when logged in as David Sinnet (tag=david) displays the file with the tag 'andy' and the file with the tag 'david'.
Can you see why its is not working as expected?
The example you showed me had both tags.
Hi Drew,
The example has two 'files'. The actual file is the same e.g. "ssh-instructions.rtf" but I uploaded them via the repeater, each with a different tag just to test the filtering.
The idea is to upload various files via the repeater and tag them with the same tag as a member so that that member only can view the file.
It's the files within the repeater I need to display/filter not the whole repeater.
Sorry for the confusion.
Drew, you're a star! Works perfectly.
Thanks for your input on this thread - very much appreciated.
Thank you, Andy