We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Join Page Adding Placeholder Text | Forum

Andrew M
Andrew M Apr 19 '13
I'm trying to figure out how to add placeholder text to the input boxes on the join_index.html page.

I can add the following -
ex: {input name=$question.name placeholder=$question.name}

but it outputs: $question.name = "questionname" as opposed to what I want, "Question Name"

The Label {label name=$question.name} outputs what I want correctly. So my question is, How do I get the placeholder to out put the text the same way the label does?

Thanks
Alia Team
Alia Apr 22 '13
Topic was moved from General Questions.
Andrew M
Andrew M Apr 22 '13
I am going to assume since this was moved to "Custom Code Modifications" that the answer is it is not possible to do without making custom code modification to the core? ;)


Thanks

Michael I.
Michael I. Apr 24 '13

This is how you can get profile question's label:


$label = OW::getLanguage()->text('base', 'questions_question_' . $question['name'] . '_label')


It should be done in PHP code. You should assign it to a template and use it the way you want:


{input name=$question.name placeholder=$label}


Andrew M
Andrew M Apr 24 '13
Awesome, thanks!
Justin Trovalds
Justin Trovalds Apr 5 '16
where is the php file in the directory
Quote from Michael I.

This is how you can get profile question's label:


$label = OW::getLanguage()->text('base', 'questions_question_' . $question['name'] . '_label')


It should be done in PHP code. You should assign it to a template and use it the way you want:


{input name=$question.name placeholder=$label}