After a long wait, I've switched from 'xtemplate' to 'php template' and jumped right in to modifying everything. In the beginning, I just did'nt get it. Now, I can't believe how easy it is and why I had so much trouble.
Anyway, I've been to http://drupal.org/node/35728 and have used many of the snippets there. I've also gone through the forums and found many snippets not listed at the above link that are very useful.
One thing I noticed was missing that I would like to have is a snippet for the 'list selector/drop down menu', used such as when choosing a country.
My profiles on my site make good use of drop down menus and I need to have this information available. I've tried hacking the 'freeform snippet' to make it work for drop down menus. Did'nt work.
Could anyone please tell me if a 'list selector/drop down menu' snippet exists and if so where? My head hurts from my banging it against the wall.
Thanks,
wim
Comments
Have you visited
Have you visited DrupalDocs.org? Specifically form_select. It's not a snippet, but that'll get the select box to appear. You just have to load your options into an array.
I've explained myself incorrectly...
Hello jeepfreak,
I thank you for your response.
However, after reading it and then re-reading my post I can see that I made a big boo boo in explaining what I need.
Here it goes:
I want to override the profile page using the php template engine. To accomplish this I will use 'template.php' and 'user_profile.tpl.php'. When this happens the profle page is re-designed based on what I put in my 'user_profile.tpl.php'. I insert the snippets whereever I need that particular functionality.
For example, in 'xtemplate' I was using the privatemessage.module and it gave a link in the user profile to send messages. When I override the user profile using 'template.php' and 'user_profile.tpl.php' I need to bring this link back up myself using the appropriate php snippet. The snippet tells the 'php template engine' where to put the private message link.
Well, I use drop down menus for users when they register. They choose something and it shows up as a link in their user profile. When I override the user profile using 'template.php' and 'user_profile.tpl.php' I need to bring up this field and tell the 'php template engine' about it. My problem is, I have no snippet for this. My question is, does this snippet now exist somewhere that I have not looked?
I thank you for your response and I apologize for not making myself clearer. Any ideas?
thanks,
wim
css based dropdown menu...
Hi Wim,
I like the idea of drop downs..there is a snippet to create Pulldown top level category links in the handbook which might help get you started.
hope that helps
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
I only need the results formatted...
Hello Dub,
Thank for your response.
However, I only need the result as a link.
For example, under 'xtemplate', when someone registered and they choose 'Ireland' from the drop down box, in their profile the link 'Ireland' would appear and only the link, not the drop down box itself because they had already made their selection when they registered. When this link is clicked, it shows all users from 'Ireland'. It is this link and ONLY this link that I need.
Now, under 'php template' when I override the user profile I have to have a snippet to tell the php template engine about it to bring up this link.
This is what I'm looking for. Any ideas?
Thanks again for your response.
wim
there's already a snippet for that..
Hi Wim,
There's already a snippet there for that under the user_profile.tpl.php snippets page..it's called..Display freeform fields snippet
I thought you meant outputing a list of Recent Blog titles in a drop down list.
Dub
P.S. I have edited the forum topic title in case others are searching and get confused.
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
I tried that...
Hello Dub,
Thanks for your response.
I tried that because I thought freeform and drop down are almost the same as far as output is concerned. It worked BUT the output was not a clickable link. It was only normal text, otherwise it worked.
Now that I know that the freeform code should work for this, my question is, how do I make the output text a clickable link?
Thanks again,
wim
p.s. thanks for the edit, even I was confused!
that snippet creates the links..!
That snippet I linked to creates the links for you...
Follow these steps to setup a COUNTRY freeform list:
Putting the snippet in your user_profile.tpl.php page
$fieldname = 'profile_keywords'to be$fieldname = 'profile_country'hope that helps
dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
If we make a selectable
If we make a selectable list, can we have an "other" category with a textbox for options not available in the drop down menu? Would it just make more sense to have a single line text field? For something like COUNTRY selection, with so many options, why is it better to have a drop down menu?
sometimes it's better to have a selectable list..
For stuff like countries and keywords, it is sometimes better to have a drop down list....
I had a problem recently where users were able to insert "business area" keywords manually..i.e. just type them in...the problem was there were many variations..such as:
User #1 Would type in "Recording Label"
User #2 Would type in "record label"
User #3 Would type in "label".
and of course, that generates 3 seperate "users in this business area" pages..which defeats the whole purpose.
Similarly with Country..I live in Ireland, which might be entered as :
Éire
Republic of Ireland
Ireland
Some people will type in ENGLAND before they would type in UK and others might type in UNITED KINGDOM instead of UK.
All of which will give you seperate profile keywords page listings.
So a drop down list solves that problem with Countries fairly easily. I remember someone on here pasted a list of all countries on here a while back you can just paste in to the selection field textarea when setting up the list selection profile field.
It's more tricky with business areas..and I think the autocomplete + ajax might help in future..i.e. when users are typing in keywords, ajax would have a quick look at existing keywords already used on the site...to nudge the user to use the same..
Hope that makes sense..
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Hello Dub,You are a star!
Hello Dub,
You are a star! Finally, I got it all working. For the longest time after I read your post, I kept getting 'page not found' when I clicked the link. After I pulled my head outta my backside, I realized that spaces were being added. Doh! Very simple, but I was'nt thinking. So, in the freeform snippet I changed this:
Removing three spaces from within the link. I appreciate all your help and handholding.
To others who are reading this, I mailed Dub privately numerous times. He ALWAYS had answers and was very helpful. I say this here because in this day an age, it's a rare thing to find such a person.
Dub, may your Guinness glass NEVER be empty.
Thanks again. I hope I can return the favor one day.
wim
no worries
glad it helped.
..although I'm slightly worried that following your post..my inbox will be full of emails with support questions..it is much better to post on the support forum.
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
I agree wholeheartedly... Dub is the man
2 questions:
1. I am also trying to include freeform links in the title of my blog pages. I found the relivant code in blog.modue. Looks like this:
Now how would I incorporate the freeform php snippit into the title code, for in this case, the profile_name field?
2. How would I go about customizing the list output that users see after clicking the link (ie. putting the picture on the left and adding more information).
By the way, I appoligize for asking all these questions. One day, I will be able to teach others, hopefully as well as Dub and rest of the outstanding minds here.
Thanks!
load_profile
recommend you have a look at the snippet for "Blogger style 'About Me' block"
the key is the
profile_load_profile($account)bit which loads the user profile with the UID=$account.if you don't want to put it in a block..you could insert the snippet into a custom node-blog.tpl.php page. Here's an example node-blog.tpl.php file I posted earlier that splits the blog text into multiple columns...which might help as a pointer..
hope that helps..it should cover both of your questions because once you call the
profile_load_profile($account)function, you can then put any user profile stuff, pretty much anywhere.Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate