Forum for discussing general topics related to Couch.
9 posts Page 1 of 1
Hey guys,

Thanks to trendoman I'm nearly done with my profile page. I have everything laid out perfectly, my forms create clonable pages just fine in the back end. However, in the front end every user is just looking at the same page. On my profile page I use the tag

<cms:pages
masterpage=k_user_template
page_id=k_user_id
limit='1'
enctype="multipart/form-data"
method='post'
anchor='0'
>

to display the user's info, however as I said, the wrong info is displayed on the page. I'm guessing the problem is with k_user_id but I'm not entirely sure why
Sorry I can't figure out how to delete the post but I've solved it, I just deleted the account and registered again and everything was there. I believe because I messed with the registration template it probably messed up the account :)
mjlxx wrote: Sorry I can't figure out how to delete the post but I've solved it, I just deleted the account and registered again and everything was there. I believe because I messed with the registration template it probably messed up the account :)



Jumped the gun there, this hasn't actually fixed the problem. When I edit the profile the changes will appear, but when I log in the profile page will be from the previous user instead of the current one.
Have you seen these examples - https://docs.couchcms.com/tags-reference/dump.html
You can check correct variable names and its values there.

My Documentation, Addons, Functions.
Join COUCH:TALK telegram channel
@mjlxx,
Please change your code from:
mjlxx wrote: <cms:pages
masterpage=k_user_template
page_id=k_user_id
limit='1'
enctype="multipart/form-data"
method='post'
anchor='0'
>


to

Code: Select all
<cms:pages 
        masterpage=k_user_template   
        id=k_user_id
        limit='1'
>

After you change the code please make sure you visit the template as a Super Admin. Then you can log in as any user and see the output on your profile. Unless you have wrong or mis-spelled editables, I am sure you will be able to see the profile page output just s you intend.

Just to help you understand, where the things are messing up please read the following:
1. Your are using Extended-Users Module which employees Data Bound Forms (DBF).
2. The code that you have used in pages, containing page_id, enctype, method, anchor are the attributes used in the cms:form tags in DBF and not with cms:pages tag.
3. While when you want to list the data from a template you can:
3.1: Display all data:
Code: Select all
<cms:pages masterpage=k_template_name >...</cms:pages>

3.2: Display specific data:
Code: Select all
<cms:pages masterpage=k_template_name id=k_page_id limit='1'>...</cms:pages>

3.3: Paginate the utput of cms:pages:
Code: Select all
<cms:pages masterpage=k_template_name limit='25' paginate='1'>...</cms:pages>


I hope you can see that code of cms:forms for DBF cannot be combined with cms:pages.

I am sure your problem will be sorted, please let us know.

Regards,
GenXCoders (Aashish)
Image
where innovation meets technology
Brilliant stuff mate, it's working perfectly now. Thanks for the explanation as well, I just copy + pasted the form tags and switched it to pages which would explain the problem. & thanks for the reading material trendoman I will check it out now :D
@mjlxx
You are welcome!
Regards!
Image
where innovation meets technology
genxcoders wrote: @mjlxx
You are welcome!
Regards!


Sorry one more quick question then I'll leave you alone. How would I create a link for users to click on to see another user's page? For example, say a user posts something, would I be able to hyperlink that user's name so someone can click it to see their profile page? I hope that makes sense
The extended users module is similar to any clonable template that one makes. So say for example, you have a blog, you can use cms:pages to list it. Similarly, you have users you can list them. In a blog list you click on the blog title (supposedly) and are sent to the page view of the blog.

Coming to the example you have sighted:
For example, say a user posts something, would I be able to hyperlink that user's name so someone can click it to see their profile page?


I would do something like:
1. When a post is created, we can have an editable (of type relation) in the post that stores the user id of the user creating the post.
2. Now you can use cms:related_pages to display the link to the user profile.

Nevertheless, if you could give more insight on what exactly you want to achieve, I would definitely help you as much as I can!

Regards,
GenXCoders (Aashish)
Image
where innovation meets technology
9 posts Page 1 of 1