Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Howdy Folks,

Hopefully this hasn't been asked before... Also, please forgive my crude explanations - I've not been doing this very long, so there is an awful lot I don't fully understand.

I have been playing around with Couch to see if it is possible to show content based on a specific member name / id / email etc etc.

While toying around, I went back to basics and played around with a blog, trying to determine whether its possible to show specific folders based on user login. So for example with a blog, I know I can list all the single / cloned blog pages on one page i.e. the blog list with
Code: Select all
<cms:pages masterpage='blog.php' folder=k_folder_name>
or perhaps be more specific and say
Code: Select all
<cms:pages masterpage='blog.php' folder='myfolder'>
...

What I cannot figure out is if its possible to adjust the view based on the individual logging in.

So the task I have in hand, is to list a bunch of documents that are specific to one individual person only. What I wanted to do is set it so that once logged in the view would show only the content from a folder that is identical to their name/id/email etc or 100% focused to them - essentially making the view:

Code: Select all
<cms:pages masterpage='blog.php' folder=k_folder_name===k_member_email / id / title / name etc>
where I have noted / I mean 'or' not 'and' = ) < again, apologies for the crude coding, hopefully it explains what I am hoping to achieve though.

Is this even possible? If so, does anyone please have any suggestions? I appreciate I could probably do this if I had individual pages / templates for each individual user, however we are talking a huge user base... So if I can ideally use just one template cloned for all users it would be much easier.

Thanks!


***Update***

OK - so I played around a little more, I have managed to achieve similar to what I want, although its a little inelegant. By adding multiple clonable pages (i.e. one per member) and then changing the k_member_title to the name of the page. I managed to embed a list of content for specific users with:

Code: Select all
<cms:pages masterpage=k_member_title folder=k_folder_name >
But again this isn't really the most elegant way to do it... plus it means for each new user I have to files to add as well as user details.

Any alternative suggestions would be most welcome!

Thanks
Hey Ash,

I think you had the answer hidden in plain sight -

<cms:member_check_login />
..
..
<cms:pages masterpage='blog.php' folder=k_member_name>

The code above will show pages from folder that matches the name of the logged-in member.
Does this do what you were looking for?
I genuinely feel like an idiot now... I went round and round in circles trying to do this and missed the most obvious option.

Thanks KK - that was exactly what I was trying to achieve... I think I fixated on the need for k_folder_name - lord knows why!

Thank you!
3 posts Page 1 of 1
cron