Example Please?  Showing entries to member based on categories they are in
Posted: 10 September 2008 10:28 AM   [ Ignore ]
Newbie
Rank
Total Posts:  19
Joined  2005-11-30

Hi,

I know there’s ways to go around it, like using embeds and stuff, but I’d just like to get an example (and perhaps you can add it to documentation) of “best practice” of showing entries based on member’s categories.  For example, this should work in theory:

{exp:user:stats member_id="{member_id}"}
{categories}
{category_body}{embed
="site/.show_entries" cat_id="{category_id}|"}{/category_body}
{
/categories}
{
/exp:user:stats}

Embed has the exp
:weblog tag parameter category=" show {embed:cat_ids}"

But is there a trick where we don’t have to use embed?

Profile
 
 
Posted: 11 September 2008 06:55 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

htmladdicts,

If that works, that’s pretty good! smile
Never thougth of that workaround before… seems like it would work.

Otherwise, there is no other way to do this.

It’s the future of User to focus on getting the Categories function rubust and use it for instances like this. smile

 Signature 
Profile
 
 
Posted: 11 September 2008 07:57 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  19
Joined  2005-11-30

Allright I’ll post if this trick works or not.  Plan to work on that today. : -)

Elise

Profile
 
 
Posted: 12 September 2008 05:06 PM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  19
Joined  2005-11-30

Hi. 

Update:  I’m pleased to report not only does my method work, but also discovered another way to do what I wanted.

With both techniques, it successfully pulls entries in categories assigned to user and when used on single entry page, will effectively block an unauthorized person from viewing.

With an exp weblog tag parameter in the embedded template site/show category="{embed:cat_ids}" and this bit belowit works.

{exp:user:stats member_id="{member_id}"}
{categories}
{embed
="site/show" cat_ids="{categories}{category_body}{category_id}|{/category_body}{/categories}"}
{
/exp:user:stats}

And thanks to Lee (sinthramyr), this is what I was looking for, a non-embed method:

{exp:user:stats parse="inward"
{exp
:weblog:entries weblog="testing" category="{categories}{category_body}{category_id}|{/category_body}{/categories}"}
{
/exp:user:stats}

- Elise

Profile
 
 
Posted: 15 September 2008 08:31 AM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Nice… thanks! smile

 Signature 
Profile