Passing page parameters to a block
Permalink
Hello.
I am trying to work out a method where the public can send a message (preferably email) to a registered user without the registered user's email address being displayed.
My idea to do this is:
To display the users in a formatted list.
For a chosen User, create a 'Contact Me' link to a hidden page and pass that Users uId to the page as a parameter.
In the 'Contact Me' page I create a form block with a field for the message, a field for the public user's email address and a submit button.
I have achieved the above.
My problems are:
How do I get the passed User's uId to the form block?
How do I get the form block to email the User? I am thinking along the lines of this:
http://www.concrete5.org/community/forums/customizing_c5/external-f...
Thanks.
I am trying to work out a method where the public can send a message (preferably email) to a registered user without the registered user's email address being displayed.
My idea to do this is:
To display the users in a formatted list.
For a chosen User, create a 'Contact Me' link to a hidden page and pass that Users uId to the page as a parameter.
In the 'Contact Me' page I create a form block with a field for the message, a field for the public user's email address and a submit button.
I have achieved the above.
My problems are:
How do I get the passed User's uId to the form block?
How do I get the form block to email the User? I am thinking along the lines of this:
http://www.concrete5.org/community/forums/customizing_c5/external-f...
Thanks.
Thanks for your help Jack.
I am new to Concrete5 but already find it to be a great CMS, especially for the ease of setting up end user administration for the site that is easy for them to follow.
I was trying to work out a direct route to a message form rather than do it via the profile.
We are already using the Enhanced User List addon and displaying all the relevant profile information in the list. Even though the email addresses are encrypted, we wanted to completely hide them from public display.
I have been in contact with Shotster about this and he has just messaged me saying that the EUL has been modified to achieve this and link to the registered User's profile directly so we will probably follow that route.
It would still be good to understand how to pass page parameters to blocks though. I have had a look at the API, but am finding it a little terse. Is there somewhere with a little more documentation?
I am new to Concrete5 but already find it to be a great CMS, especially for the ease of setting up end user administration for the site that is easy for them to follow.
I was trying to work out a direct route to a message form rather than do it via the profile.
We are already using the Enhanced User List addon and displaying all the relevant profile information in the list. Even though the email addresses are encrypted, we wanted to completely hide them from public display.
I have been in contact with Shotster about this and he has just messaged me saying that the EUL has been modified to achieve this and link to the registered User's profile directly so we will probably follow that route.
It would still be good to understand how to pass page parameters to blocks though. I have had a look at the API, but am finding it a little terse. Is there somewhere with a little more documentation?
Im not entirely sure what you mean by page parameters. But heres some basics:
You can get the current page with $p=Page::getCurrentPage();
and can then access all the page values documented here:
http://www.concrete5.org/documentation/developers/pages/overview...
Another option would be to use $_GET parameters in the page.
Does that make sense or is that not what you are asking?
You can get the current page with $p=Page::getCurrentPage();
and can then access all the page values documented here:
http://www.concrete5.org/documentation/developers/pages/overview...
Another option would be to use $_GET parameters in the page.
Does that make sense or is that not what you are asking?
Thanks for that.
What I mean is that I am passing an argument to the page. For instance:
http://www.site.url/index.php/contact-me?userId=444...
How would I get to userId within my block?
What I mean is that I am passing an argument to the page. For instance:
http://www.site.url/index.php/contact-me?userId=444...
How would I get to userId within my block?
That's a get parameter and can be aceesed with $_GET['userId']
Sent from my iPod
Sent from my iPod
Theres a really easy way to do this in concrete5- private messages. To get that up in running, you want to enable public profiles (should be in the dashboard under sitewide settings) A new page should show up in the auto nav called members. To private message a user, simply go to their page, and click on the private message link on the left sidebar.
Note that a user has to have selected that they would like to recieve pms by email for them to be sent automatically though.